首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >symfony 2找不到"GET /“的路由

symfony 2找不到"GET /“的路由
EN

Stack Overflow用户
提问于 2011-11-29 05:03:28
回答 6查看 109.1K关注 0票数 22

当我尝试运行http://localhost/app_dev.php时,Symfony2返回No route found for "GET /“,但这个url有效:http://localhost/app_dev.php/hello/Symfony。我删除了AcmeDemoBundle,并尝试运行symfony2教程中的示例捆绑包。出什么问题了?

app/config/routing.yml:

ShopMyShopBundle:
resource: "@ShopMyShopBundle/Resources/config/routing.yml"
prefix:   /

app/config/routing_dev.yml:

_assetic:
resource: .
type:     assetic

_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix:   /_wdt

_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix:   /_profiler

_configurator:
resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
prefix:   /_configurator

_main:
resource: routing.yml

src/Shop/MyShopBundle/Resources/config/routing.yml:

ShopMyShopBundle_homepage:
pattern:  /hello/{name}
defaults: { _controller: ShopMyShopBundle:Main:index }
requirements:
    _method:  GET
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8302270

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档