Symfony2: No route found for “GET /lucky/number”

后端 未结 11 1268
北荒
北荒 2021-02-18 14:17

I start the tutorial (as newbie) and everythings works fine till:

http://symfony.com/doc/current/book/page_creation.html#creating-a-page-route-and-controller at step

11条回答
  •  情话喂你
    2021-02-18 15:04

    I copied and pasted your controller in an existing Symfony project and the route immediately appeared. So nothing wrong with the controller.

    I also compared the routing.yml and it's the same.

    The only thing that's left is to check the folder structure and make sure you don't have different Symfony projects mixed together; maybe you're editing the right file but starting the web server from a different path.

    Check carefully or rebuild the project in a completely different path. Since you're testing with the embedded web server, you don't need to put your project into /var/www/html (in fact it's better not to).

提交回复
热议问题