php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml
這個語句一直斷行符號產生代碼之後 然後 訪問/app_dev.php/hello/ 顯示
No route found for "GET /hello/"
配置如下:
#Resources\config\routing.yml acme_hello_homepage: path: /hello/{name} defaults: { _controller: AcmeHelloBundle:Default:index } #app\config\routing.yml acme_hello: resource: "@AcmeHelloBundle/Resources/config/routing.yml" prefix: /
symfony 版本為2.5.6
本人對於這個架構只限於看了官方的文檔,我自己研究了會不知道為啥還是不行
望哪位大大 能提點下~~
回複內容:
php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml
這個語句一直斷行符號產生代碼之後 然後 訪問/app_dev.php/hello/ 顯示
No route found for "GET /hello/"
配置如下:
#Resources\config\routing.yml acme_hello_homepage: path: /hello/{name} defaults: { _controller: AcmeHelloBundle:Default:index } #app\config\routing.yml acme_hello: resource: "@AcmeHelloBundle/Resources/config/routing.yml" prefix: /
symfony 版本為2.5.6
本人對於這個架構只限於看了官方的文檔,我自己研究了會不知道為啥還是不行
望哪位大大 能提點下~~
你試過清除cache了嗎?
清除命令是:
app/console cache:clear --env=prodapp/console cache:clear --env=dev
同樣的,你需要檢查route是否配置正確
app/console router:debug
路由是 /hello/{name}
你訪問 /hello/mot 就有了