title: Override Registration Controller with fosuser Cannot autowire service "App\Controller\RegistrationController"
body: <p>I am trying to override the FosUserBundle Registry Controller, but the following error appears:</p>
  
  <p><code>
  Cannot autowire service "App\Controller\RegistrationController": argument "$formFactory" of method 
  "FOS\UserBundle\Controller\RegistrationController::__construct()" 
  references interface "FOS\UserBundle\Form\Factory\FactoryInterface" but no such service exists. 
  You should maybe alias this interface to one of these existing services: "fos_user.profile.form.factory", "fos_user.registration.form.factory", "fos_user.change_password.form.factory",
  "fos_user.resetting.form.factory". Did you create a class that implements this interface?
  </code></p>
  
  <p>I'm using Symfony4 and this is my <code>RegistrationController.php</code> code.
  I've tried multiple ways, but I can't find a way to make it work.</p>
  
  <pre><code>class RegistrationController extends BaseController
          {
  
              public function registerAction(Request $request)
              {
  
                  $form                = $this-&gt;get('fos_user.registration.form.factory');
                  $formHandler         = $this-&gt;get('fos_user.registration.form.handler');
                  $confirmationEnabled = $this-&gt;getParameter('fos_user.registration.confirmation.enabled');
  
                  die("Hello");
  
                  $process = $formHandler-&gt;process($confirmationEnabled);
                  if ($process) {
                      $user = $form-&gt;getData();
  
                      if ($confirmationEnabled) {
                          $this-&gt;get('session')-&gt;set('fos_user_send_confirmation_email/email', $user-&gt;getEmail());
                          $route = 'fos_user_registration_check_email';
                      } else {
                         // $this-&gt;authenticateUser($user);
                          $route = 'users_edit';
                      }
  
                      $this-&gt;setFlash('fos_user_success', 'registration.flash.user_created');
                      $url = $this-&gt;get('router')-&gt;generate($route, array("id" =&gt; $user-&gt;id));
  
                      return new RedirectResponse($url);
                  }
  
                  return $this-&gt;get('templating')-&gt;renderResponse('FOSUserBundle:Registration:register.html.twig', array(
                      'form' =&gt; $form-&gt;createView()
                  ));
              }
  
  
          }
      ?&gt;
  </code></pre>