I use the FOSUserBundle and I want to override his registerAction controller. I read the documentation related to overriding controllers of FOSUserBundle but it doesn't work. By echoing a little message in the controller, it is not print in the template.
Here is the way I chose :
I inherit my bundle from FOSUserBundle :
namespace Jheberg\MembersBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class JhebergMembersBundle extends Bundle
{
public function getParent()
{
return 'FOSUserBundle';
}
}
And I override registerAction in the file named RegistrationController.php
in the controller directory of my bundle :
namespace Jheberg\MembersBundle\Controller;
use FOS\UserBundle\Controller\RegistrationController as BaseController;
class RegistrationController extends BaseController
{
public function registerAction()
{
echo 'foo';
$response = parent::registerAction();
// do custom stuff
return $response;
}
}
Have you got any solution ?
routing.yml
(which is blank by default). I was using the default and Symfony really will read everything from the 'child' bundle in place of the parent if it has the same filename. - Tatsh