0

我正在使用 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(),

什么可能导致这些错误?

4

1 回答 1

0

就我而言,在尝试生产 url 时,我遇到了同样的错误。

在 app/AppKernel.php 中有一个条件只考虑“开发”和“测试”环境:

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

如果您的捆绑包也应该在 prod 环境中启用,您应该修改条件:

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

这为我解决了错误。

于 2012-08-21T13:49:56.143 回答