I use Symfony Version 2.8. I get the following error when generating a new bundle.
I generate a new bundle using this command:
php bin/console generate:bundle --namespace=FrontBundle --no-interaction
Then the console show me this results
Bundle generation
Generating a sample bundle skeleton into C:\xampp\htdocs\TRC\app/../src/FrontBundle created .\app/../src/FrontBundle/ created .\app/../src/FrontBundle/FrontBundle.php created .\app/../src/FrontBundle/Controller/ created .\app/../src/FrontBundle/Controller/DefaultController.php created .\app/../tests/FrontBundle/Controller/ created .\app/../tests/FrontBundle/Controller/DefaultControllerTest.php created .\app/../src/FrontBundle/Resources/views/Default/ created .\app/../src/FrontBundle/Resources/views/Default/index.html.twig created .\app/../src/FrontBundle/Resources/config/ created .\app/../src/FrontBundle/Resources/config/services.yml Checking that the bundle is autoloaded FAILED Enabling the bundle inside C:\xampp\htdocs\TRC\app\AppKernel.php updated .\app\AppKernel.php OK Importing the bundle's routes from the C:\xampp\htdocs\TRC\app\config\routing.yml file updated .\app/config/routing.yml OK Importing the bundle's services.yml from the C:\xampp\htdocs\TRC\app\config\config.yml file updated .\app/config/config.yml OK
The command was not able to configure everything automatically.
You'll need to make the following changes manually.Edit the composer.json file and register the bundle namespace in the "autoload" section:
Process finished with exit code 0 at 17:19:48. Execution time: 719 ms.
Then I add a line to Composer.Json in autoload section:
#...
"autoload": {
"psr-4": {
"AppBundle\\": "src/AppBundle",
"FrontBundle\\": "src/FrontBundle"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload-dev": {
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
},
#.........
Finally, I use again the console to dump-autoload and when I refresh the page I get the same error.
I have tried to clear cache and force browser to refresh.