I am new to Symfony, and I am in the process of doing some basic configuration. When running my application on my localhost I keep getting the error below. Does anyone know how to solve this error:
Some sections on my autoload.php are commented out.
Thanks in advance.
RuntimeException: The autoloader expected class "IWA\AppBundle\AppBundle" to be defined in file "C:\xampp\htdocs\Rumbie\intranet/src\IWA\AppBundle\AppBundle.php". The file was found but the class was not in it, the class name or namespace probably has a typo.
My AppBundle looks like this:
<?php
namespace IWAAppBundle\AppBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AppBundle extends Bundle
{
}
And my autoload file looks like this:
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;
use Symfony\Component\ClassLoader\UniversalClassLoader;
/**
* @var ClassLoader $loader
*/
#$loader = new UniversalClassLoader();
#$loader->registerNamespaces(array(
# 'FOS' => __DIR__.'/../vendor/bundles',
#));
$loader = require __DIR__.'/../vendor/autoload.php';
#$loader ->add('FOS', __DIR__.'/../vendor/friendsofsymfony/user-bundle/FOS');
$loader->registerNamespaces(array(
'FOS' =>$vendor_dir .'/bundles',
#'Symfony' => array('FOS' => _DIR_.'/../vendor/bundles',
)
);
AnnotationRegistry::registerLoader(array($loader,'loadClass'));
return $loader;