handcraftedinthealps/rest-routing-bundle

此包为Controllers提供自动路由注册功能

1.1.1 2024-04-15 11:20 UTC

This package is auto-updated.

Last update: 2024-09-15 16:26:32 UTC


README

GitHub license GitHub tag (latest SemVer) Github Test workflow status

此包为FOSRestBundle 3.0提供自动路由生成功能。

文档

阅读文档

安装

所有安装说明位于文档中。

从FOSRestBundle迁移

如果您之前使用过FOSRestBundle(该包已移除自动路由生成),迁移过程简单。安装包成功后,更改配置为新包

之前

fos_rest:
    routing_loader:
        default_format: 'json'
        prefix_methods: true
        include_format: true

之后

handcraftedinthealps_rest_routing:
    routing_loader:
        default_format: 'json'
        prefix_methods: true
        include_format: true
        # optional set supported formats else the configured one from fos_rest are used if installed:
        # formats:
        #     json: true
        #     xml: true

更新类(非必需但推荐)

// Replace ClassResourceInterface
-use FOS\RestBundle\Routing\ClassResourceInterface;
+use HandcraftedInTheAlps\RestRoutingBundle\Routing\ClassResourceInterface;

// Replace RouteResource
-use FOS\RestBundle\Controller\Annotations\RouteResource;
+use HandcraftedInTheAlps\RestRoutingBundle\Controller\Annotations\RouteResource;

// Replace NamePrefix
-use FOS\RestBundle\Controller\Annotations\NamePrefix;
+use HandcraftedInTheAlps\RestRoutingBundle\Controller\Annotations\NamePrefix;

// Replace Prefix
-use FOS\RestBundle\Controller\Annotations\Prefix;
+use HandcraftedInTheAlps\RestRoutingBundle\Controller\Annotations\Prefix;

// Replace NoRoute
-use FOS\RestBundle\Controller\Annotations\NoRoute;
+use HandcraftedInTheAlps\RestRoutingBundle\Controller\Annotations\NoRoute;

// Replace Version
-use FOS\RestBundle\Controller\Annotations\Version;
+use HandcraftedInTheAlps\RestRoutingBundle\Controller\Annotations\Version;

许可证

此包受MIT许可证保护。查看完整的许可证(在包中)