我正在使用Jobeet教程。
我已经在app/confing文件中配置了路由,配置如下:
EnsJobeetBundle:
resource: "@EnsJobeetBundle/Resources/config/routing.yml"
prefix: /在EnsJobeetBundle路由中,其定义如下:
EnsJobeetBundle_job:
resource: "@EnsJobeetBundle/Resources/config/routing/job.yml"
prefix: /job当我使用URL http://localhost/Symfony/web/app_dev.php/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文件中注册了如下内容:
new Ens\JobeetBundle\EnsJobeetBundle(),导致这些错误的原因是什么?
发布于 2012-08-21 21:49:56
在我的例子中,当尝试生产url时,我得到了同样的错误。
在app/AppKernel.php中,有一个条件只考虑'dev‘和'test’环境:
if (in_array($this->getEnvironment(), array('dev', 'test')))如果还应在prod环境中启用捆绑包,则应修改条件:
if (in_array($this->getEnvironment(), array('prod', 'dev', 'test')))这为我解决了这个错误。
https://stackoverflow.com/questions/11736901
复制相似问题