french_dev french_dev - 1 year ago 234
PHP Question

Symfony 2.5 Case mismatch between loaded and declared class names

I have this error when I try to proceed with Symfony 2.5:

Case mismatch between loaded and declared class names: MySpace\WelcomeBundle\Controller\HomepageController vs MySpace\WelcomeBundle\Controller\HomePageController

Here's my code in app/config/routing.yml

resource: "@MySpaceBundle/Resources/config/routing.yml"
prefix: /

Here's my code in my bundle MySpace, in src/MySpace/WelcomeBundle/Controller/HomePageController.php:


namespace MySpace\WelcomeBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class HomePageController extends Controller
public function indexAction()
return $this->render('MySpaceWelcomeBundle:HomePage:index.html.twig');

and finally this is my code in src/MySpace/WelcomeBundle/Ressources/config/routing.yml

pattern: /
defaults: { _controller: MySpaceWelcomeBundle:Homepage:index }

Someone could explain me exactly what is the problem?

Answer Source

I guess the problem is with src/MySpace/WelcomeBundle/Ressources/config/routing.yml, as you have Homepage with lowecase. Try to change it to:

pattern:  /
defaults: { _controller: MySpaceWelcomeBundle:HomePage:index }
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download