Search code examples
phpsymfonycontrollerroutes

Symfony, routing.yml is not working


I have a project in sympfony. Im trying to add a new page, and i have done usual steps, but nothing seems to work. I have added the following to src/ITWB/FrontBundle/Resources/config/routing.yml:

itwb_front_abc:
pattern: /abcCenter
defaults: { _controller: ITWBFrontBundle:Footer:abcCenter }

In my src/ITWB/FrontBundle/Controller/FooterController.php i have added this:

public function abcCenterAction() { 
return $this->render('ITWBFrontBundle::test.html.twig');
}

But it's not working. I have tried putting and "echo" inside the action, and it isnt displaying, so, the problem is in the routing, domain.com/abcCenter its not being recognized. I have also tried with other names and it's the same.

What can i do ? Thanks


Solution

  • Take care of indent, like Wouter J says.

    You can access abcCenter via domain.com/app_dev.php/abcCenter (not domain.com/abcCenter) if your website is running local, otherwise you have to clear cache:

    php app/console cache:clear --env=prod --no-debug
    

    How to deploy a Symfony2 application.