【发布时间】:2018-12-23 04:33:46
【问题描述】:
你有这个 /src/AppBundle/Resources/views/tests/index.html.twig 只包含:
{{text}}
并且由 /src/AppBundle/Controller/TestsController.php 控制,该文件在渲染“文本”的函数上使用 Route 可以正常工作。现在我想要一个位于 /src/AppBundle/Resources/config/routing.yml 的路由文件。显然,在旧版本中,这可以通过以下方式完成:
tests_index:
path: /tests/index
defaults: [_controller: AppBundle:Tests:index]
但是当我尝试通过http://localhost/project/web/tests/index 联系它时,也许我错过了一些东西,或者新的 Symfony 没有购买它。错误是:
找不到路径“/pruebas/index”的控制器。路线是 配置错误。
【问题讨论】: