1

当我尝试访问 localhost/Symfony/web/app_dev.php/Categoria/ 时,Symfony2 返回 No route found for "GET /Categoria/",页面 localhost/Symfony/web/app_dev.php/hello/Guido 有效。

src\grupo85\entregaFinalBundle\Resources\config\routing.yml:

grupo85entrega_final_homepage:
pattern:  /hello/{name}
defaults: { _controller: grupo85entregaFinalBundle:Default:index }

应用\配置\路由.yml:

grupo85entrega_final:
  resource: "@grupo85entregaFinalBundle/Resources/config/routing.yml"
  prefix:   /

grupo85entregaFinalBundle:
  resource: "@grupo85entregaFinalBundle/Controller/"
  type: annotation
  prefix: /

php 应用程序/控制台路由:调试

categoria                     GET    ANY    ANY  /categoria/
categoria_create              POST   ANY    ANY  /categoria/
categoria_new                 GET    ANY    ANY  /categoria/new
categoria_show                GET    ANY    ANY  /categoria/{id}
categoria_edit                GET    ANY    ANY  /categoria/{id}/edit
categoria_update              PUT    ANY    ANY  /categoria/{id}
categoria_delete              DELETE ANY    ANY  /categoria/{id}

我还尝试运行 cache:clear --env prod 命令并手动删除 pp/cache 文件夹。怎么了?谢谢。

4

1 回答 1

2

请理解错误信息。您没有路线/Categoria/。你有路线/categoria/。请注意小写。SF2 路由器识别小写和大写。

于 2013-05-05T12:58:05.270 回答