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
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
The first place I would look: in app/config/routing.yml, do you have a reference to your bundle's routing.yml?
The app/config/routing.yml file should contain a couple of lines something like this:
front_bundle:
resource: "@FrontBundle/Resources/config/routing.yml"
Of course maybe you've done this already as part of the "usual steps" you mention?
You forgot the indent the options. Indenting is a really important aspect of Yaml:
itwb_front_abc:
pattern: /abcCenter
defaults: { _controller: ITWBFrontBundle:Footer:abcCenter }