yottacms / yotta-router-bundle
Yotta 路由包
v0.1.4
2018-02-06 15:01 UTC
Requires
- php: >=7.1
- sensio/framework-extra-bundle: ^5.1
- symfony-cmf/routing-bundle: dev-master
Requires (Dev)
- phpunit/phpunit: ^5.6.4
- symfony/config: ^3.4||^4.0
- symfony/dependency-injection: ^3.4||^4.0
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 进行自己的路由配置。包括使用此包连接的路径重写。