2012-07-31 69 views
0

我正在使用Jobeet教程。無法導入symfony中的路由

我已經配置在應用程序中的路由/ confing文件如下:

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

在EnsJobeetBundle路由,定義如下:當我使用的URL http://localhost/Symfony/web/app_dev.php/job/我得到的

EnsJobeetBundle_job: 
    resource: "@EnsJobeetBundle/Resources/config/routing/job.yml" 
    prefix: /job 

以下錯誤:

Cannot import resource "@EnsJobeetBundle/Resources/config/routing/job.yml" 
from "C:\wamp\www\Symfony\src\Ens\JobeetBundle/Resources/config/routing.yml". 
Make sure the "EnsJobeetBundle/Resources/config/routing/job.yml" bundle 
is correctly registered and loaded in the application kernel class. 

我也在appkernel文件中註冊爲fo llow:

new Ens\JobeetBundle\EnsJobeetBundle(), 

什麼可能會導致這些錯誤?

+0

請粘貼你的'job.yml' – 2012-07-31 09:24:00

回答

0

在我的情況下,當嘗試生產url時,我得到了同樣的錯誤。

在app/AppKernel.php有是隻考慮「開發」和「測試」的環境條件:

if (in_array($this->getEnvironment(), array('dev', 'test'))) 

,如果你的包也應該在PROD環境中啓用你應該修改條件:

if (in_array($this->getEnvironment(), array('prod', 'dev', 'test'))) 

這解決了我的錯誤。