您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

symfony命令行生成bundle后访问对应地址报404

2025/8/15 23:49:03发布14次查看
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 就有了
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product