yottacms/yotta-router-bundle

Yotta 路由包

v0.1.4 2018-02-06 15:01 UTC

This package is auto-updated.

Last update: 2024-09-15 07:00:35 UTC


README

使使用 Symfony Router 更加简单。只需创建一个抽象的 Router 服务和指向 routing.yml 文件的路径

安装

composer require yottacms/yotta-router-bundle
// config/bundles.php
// ...
return [
    \YottaCms\Bundle\YottaRouterBundle\YottaRouterBundle::class => ['all' => true],
    // ...
];

使用

# @YourBundle/Resources/config/services.yml
yourbundle.service_router_name:
    public: false
    class: Symfony\Component\Routing\Router
    arguments: ['@routing.loader', '@@YourBundle/Resources/config/routing.yml']
    tags: [router]
    # OR tags: - { name: router, priority: 10 }

建议

您可以使用标准 app/config/routing.yml 进行自己的路由配置。包括使用此包连接的路径重写。