symfony2:找不到AppKernel中包含的FOSLasticaBundle类


symfony2: FOSElasticaBundle class included in AppKernel can not be found

我使用Composer安装了FOSLasticaBundle,之后按照https://github.com/FriendsOfSymfony/FOSElasticaBundle我在Appkernel.php文件中注册了FOSElasticaBundle类,演示代码如下

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new FOS'ElasticaBundle'FOSElasticaBundle(),
    );
}

但问题是在AppKernel.php文件中注册new FOS'ElasticaBundle'FOSElasticaBundle(),之后。我正试图从netbeans运行Symfony命令,但它显示错误

致命错误:在中找不到类"FOS''ElasticaBundle''FOSLasticaBundle"AppKernel.php文件

请给我一些解决这个问题的办法。感谢

我找到了解决方案。

完成FosElasticaBundle的配置后。

添加此行

$loader->add('FOS', DIR.'/../vendor/friendsofsymfony/elastica-bundle/FOS');

到您的app/autoloader.php文件中。这是我的工作。

谢谢。

相关文章:
  • 没有找到相关文章