title: FOSUserBundle registration customize
body: <p>What I am trying to do is nothing hard. This is my first project on symfony and it's really confusing.</p>
  
  <p>I am using FOSUSerbundle. I dont want to have a login and registration bellow <code>/login</code> and <code>/registration</code></p>
  
  <p>So I made a bundle which  is child of FOSUSerbundle ... and it overrides its twigs.</p>
  
  <p>I have ::base.html.twig where I include header.html.twig and there I have: <code>{% render 'FOSUserBundle:Security:login' %}</code> which render my teplate (overrided the FOS one) works gr8. Even the errors after submiting are rendering on the ::base template bellow "/" route.</p>
  
  <pre><code>#Security.yml
      form_login:
          check_path: /login_check
          login_path: /
          provider: fos_userbundle
  </code></pre>
  
  <p>Works great.</p>
  
  <p>And I need to do exactly that same for my registration.</p>
  
  <p>So in <code>::base</code> I include <code>welcome_page.html.twig</code> where I code <code>{% render 'FOSUserBundle:Registration:register' %}</code> and there I have under my rewrited template: <code>WelcomePageBundle:Registration:register.html.twig</code> this:</p>
  
  <pre><code>{% block fos_user_content %}
  {% include "FOSUserBundle:Registration:register_content.html.twig" %}
  {% endblock fos_user_content %}[/code]
  </code></pre>
  
  <p>which also include from MY rewrited bundle: <code>WelcomePageBundle:Registration:register_content.html.twig</code> this:</p>
  
  <pre><code>{% for key, message in app.session.getFlashes() %}
  &lt;div class="{{ key }}"&gt;
      {{ message|trans({}, 'FOSUserBundle') }}
  &lt;/div&gt;
  {% endfor %}
  
  &lt;form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" id="register_form"&gt;
      {{ form_widget(form) }}
      {{ form_rest(form) }}
  
      &lt;input type="submit" class="registration_submit" value="{{     'welcome_page.registration_box.register_submit'|trans }}"/&gt;
  &lt;/form&gt;
  
  &lt;div class="v_pripade"&gt;
      {{ 'welcome_page.registration_box.with_reg_problems'|trans }}
      &lt;span style='color: #fff568'&gt;{{ 'welcome_page.registration_box.with_reg_problems_part2'|trans }}&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Everything works like a charm... all the files are included and displayed greate. But the problem comes now.</p>
  
  <p>When I go to route <code>/register</code></p>
  
  <p>(which is basic route from FOS bundle)</p>
  
  <pre><code>&lt;route id="fos_user_registration_register" pattern="/register"&gt;
    &lt;default key="_controller"&gt;FOSUserBundle:Registration:register&lt;/default&gt;
  &lt;/route&gt;
  </code></pre>
  
  <p>... fill data and click submit... it works. The errors are displayed or registration is succes..</p>
  
  <p>But when I submit form from my route <code>/</code> where the registration controller is rendered (rendered ok) it takes my to this route <code>:/register</code> which is normal behaviour because this path:</p>
  
  <pre><code>&lt;form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form)    }} method="POST" id="register_form"&gt;
  </code></pre>
  
  <p>... this site isn't extended by nothing so its just clean form on white page with errors... OK</p>
  
  <p>But how can I possible make work this form with displaying errors and success ON MY ::base template like the login? and dont go to <code>/register</code> route? I tried replace <code>/register</code> for <code>/</code> which bring me to my <code>::base</code> template (like in login I do).</p>
  
  <pre><code>#security.yml
  form_login:
      check_path: /login_check
      login_path: /
      provider: fos_userbundle
  </code></pre>
  
  <p>But none of the errors or success are displayed ...</p>
  
  <p>Do anyone know solution?</p>