当我尝试运行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
https://stackoverflow.com/questions/8302270
复制相似问题