2016-04-25 117 views
1

我正在开发Symfony 2应用程序(版本2.6.1),但我只能在PROD模式下运行它。当试图访问以下网址:仅在PROD环境中运行的Symfony 2.6.1应用程序

http://localhost/lawAdmin/web/app_dev.php 

我有一个错误信息:

RouteNotFoundException在appDevUrlGenerator.php线32:无法 生成的URL命名路线“ _profiler“这样的路线不存在 。

无论我的routing.yml和routing_dev.yml文件看起来是一样的:

law_admin: 
    resource: "@LawAdminBundle/Controller/DefaultController.php" 
    type:  annotation 
    prefix: /

运行

app/console debug:router 

回报:

[router] Current routes 
Name   Method Scheme Host Path 
porfolio_show GET ANY ANY/
gallery_show GET ANY ANY /gallery/{galleryId} 

我也试过以下命令以防万一:

php app/console cache:clear 

回答

2

你的路由dev的更改

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

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

_main: 
    resource: routing.yml 

这将加载在开发环境探查器和工具栏的路线,并从的routing.yml文件中加载自己的应用程序的路线。

+0

谢谢,quentinus95!就是这样!让我感到意外的是,我预计配置文件默认位于我的routing_def文件中。但它是空的... – MiGU

相关问题