SF4:在可重复使用的捆绑包中添加路由

时间:2018-08-27 19:43:16

标签: symfony4

我想创建一个可重用的包,例如可通过=Parameters!Input.Label<> "One&Two" AND Parameters!Input.Label<> "All" 安装,我需要向路由器注入一些路由。我无法通过注释或RouteLoader来实现。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

使用旧方法,使用yml或xml创建配置文件,然后放置路由。

摘自文档:

<your-bundle>/
├─ AcmeBlogBundle.php
├─ Controller/
├─ README.md
├─ LICENSE
├─ Resources/
│   ├─ config/
│   │  └─ routing.yml
│   ├─ doc/
│   │  └─ index.rst
│   ├─ translations/
│   ├─ views/
│   └─ public/
└─ Tests/

请参阅:https://symfony.com/doc/current/bundles/best_practices.html#directory-structure

相关问题