Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7977127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:06:16+00:00 2026-06-04T09:06:16+00:00

I use the FOSUserBundle and I want to override his registerAction controller. I read

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:06:18+00:00Added an answer on June 4, 2026 at 9:06 am

    Just spent hours trying to get this working and finally figured it out. The part I was missing was extending my User class with a User entity from within MyUserBundle. For instance:

    namespace MyNamespace\MyMainBundle\Entity;
    
    use MyNamespace\MyUserBundle\Entity\User as BaseUser;
    
    class User extends BaseUser
    {
    }
    

    The User entity is identical to the one in the FOSUserBundle (just with a different namespace).

    namespace MyNamespace\MyUserBundle\Entity;
    
    use FOS\UserBundle\Model\User as AbstractUser;
    
    abstract class User extends AbstractUser
    {
    }
    

    If I didn’t do this, as Jeffrey mentioned, MyUserBundle wasn’t used at all (as if it didn’t exist). Now all my overridden views, controllers etc. are being used. Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code, but it doesn't work: $builder->add('name','text',array( 'label' => 'Due Date', ));
I use the FOSUserBundle and in my User class I want two things: a
I've got a problem when I want to override the FOSUserBundle registration Form. The
use C#,want to upload excel file on google doc. bellow syntax use to upload
I use Symfony 2 and the FOSUserBundle. I can login, logout and view Profile.
I'm trying to override FOSUserBundle form Edit profile ; I have created the class
I am attempting to override the RegistrationFormType in the Symfony2 FOSUserBundle. I am following
I am trying to use the FOS_UserBundle for managing my users but everytime I
I cant get the form_widget (from mopabootstrapbundle) to use the translation (from FOSUserBundle) to
use Rack::Session::Pool ... session[:msg]=Hello Rack EDIT: The word session doesn't seem to resolve. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.