I am installing the FOSUserBundle
which i have downloaded from Knpbundle.
I have configured it properly as the instruction given.
I have created a route so my 'app/config/routing.yml'
is as bellow.
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
fos_user_profile:
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
prefix: /profile
fos_user_register:
resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
prefix: /register
fos_user_resetting:
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
prefix: /resetting
fos_user_change_password:
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: /profile
acme_user:
resource: "@AcmeUserBundle/Resources/config/routing.yml"
prefix: /
And my routing.yml file is as bellow.
AcmeUser_Bundle:
pattern: /admin
defaults: { _controller: AcmeUserBundle:User:index}
As soon as I pass /admin
in my url it will called the index file view which I have created.the index
file looking like this.
<body>
<section id="login_form">
<div class="login_form_head">Administration</div>
<form id="admin_login_form" class="formee" method="post" action="{{
path('fos_user_security_check') }}" enctype="multipart/form-data">
<div class="login_form_display">
<div class="login_row"><input type="text" name="_username"
class="validate[required,custom[username]]" id="username"
placeholder="Username" /></div>
<div class="clear"></div>
<div class="login_row"><input type="password" class="validate[required,custom[passwordLogin]]"
name="_password" id="password" placeholder="Password" /></div>
<div class="clear"></div>
</div>
<!--Form footer begin -->
<section class="login_footer">
<div class="textcenter"><input type="submit" value="Login" /></div>
<div class="clear"></div>
</section>
<!--Form footer end -->
</form>
</section><!-- End of #container -->
<div>
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
{{ 'layout.logged_in_as'|trans({'%username%': app.user.username}, 'FOSUserBundle') }} |
<a href="{{ path('fos_user_security_logout') }}">
{{ 'layout.logout'|trans({}, 'FOSUserBundle') }}
</a>
{% else %}
<a href="{{ path('fos_user_security_login') }}">{{ 'login'|trans({}, 'FOSUserBundle') }}</a>
{% endif %}
</div>
{% for type, messages in app.session.flashbag.all() %}
{% for key, message in messages %}
<div class="flash-{{ type }}">
{{ message|trans({}, 'FOSUserBundle') }}
</div>
{% endfor %}
{% endfor %}
<div>
{% block fos_user_content %}
{% endblock fos_user_content %}
</div>
</body>
It shows the csrfToken
error. So pls can any one help me understand.