symfony2: FOSElasticaBundle class included in AppKernel can not be found

627 views Asked by At

i installed FOSElasticaBundle using Composer, After that as per the given instruction on https://github.com/FriendsOfSymfony/FOSElasticaBundle i registered FOSElasticaBundle Class in Appkernel.php file, demo code is as following

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new FOS\ElasticaBundle\FOSElasticaBundle(),
    );
}

But the Problem is after registering new FOS\ElasticaBundle\FOSElasticaBundle(), in the AppKernel.php file. i am trying to run Symfony command from netbeans but it is showing Error

Fatal error: Class 'FOS\ElasticaBundle\FOSElasticaBundle' not found in AppKernel.php file

Please Give me Some Solution for this problem. Thank you

1

There are 1 answers

0
NGPATEL On BEST ANSWER

I found the solution.

After doing complete configuration of FosElasticaBundle.

Add this line

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

into your app/autoloader.php file. that's work for me.

thank you.