What I'm trying to do is not complicated. This is my first symfony project and it is really confusing.
I am using FOSUSerbundle. I do not want to have registration and registration below /login and /registration
So, I made a bunch, which is a child of the FOSUSerbundle ... and it overrides its branches.
I have :: base.html.twig where I include header.html.twig, and there I have: {% render 'FOSUserBundle:Security:login' %} that displays my tag (overridden by FOS), gr8 works . Even errors after sending are displayed on the :: base template below "/".
It works great.
And I need to do the same for my registration.
So, in ::base I include welcome_page.html.twig , where I code {% render 'FOSUserBundle:Registration:register' %} , and I have under my rewritten template: WelcomePageBundle:Registration:register.html.twig this:
{% block fos_user_content %} {% include "FOSUserBundle:Registration:register_content.html.twig" %} {% endblock fos_user_content %}[/code]
which also include MY rewritten package: WelcomePageBundle:Registration:register_content.html.twig this:
{% for key, message in app.session.getFlashes() %} <div class="{{ key }}"> {{ message|trans({}, 'FOSUserBundle') }} </div> {% endfor %} <form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" id="register_form"> {{ form_widget(form) }} {{ form_rest(form) }} <input type="submit" class="registration_submit" value="{{ 'welcome_page.registration_box.register_submit'|trans }}"/> </form> <div class="v_pripade"> {{ 'welcome_page.registration_box.with_reg_problems'|trans }} <span style='color: #fff568'>{{ 'welcome_page.registration_box.with_reg_problems_part2'|trans }}</span> </div>
Everything works like a charm ... all files are included and displayed greate. But the problem is now.
When I go to the /register route
(which is the main route from the FOS package)
<route id="fos_user_registration_register" pattern="/register"> <default key="_controller">FOSUserBundle:Registration:register</default> </route>
... fill in the data and click "Submit ...". Errors are displayed or successful registration occurs.
But when I submit the form from my route / , where the registration handler is displayed (displayed normally), it accepts my route :/register , which is normal behavior, because this path:
<form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" id="register_form">
... this site is not expanding anything, so its just a clean form on a white page with errors ... OK
But how can I do the work with this form with the display of errors and successes on the MY :: base template, for example, at login? and don’t go to the /register route? I tried replacing /register with / , which led me to my ::base pattern (e.g. when logging in).
But none of the errors or results are displayed ...
Does anyone know a solution?