Skip to content

Latest commit

 

History

History
81 lines (57 loc) · 2.22 KB

fos_userbundle.md

File metadata and controls

81 lines (57 loc) · 2.22 KB

FOSUserBundle integration

This bundle is prepared for a flawless integration with FOSUserBundle, but its not coming out-of-the-box.

First follow the installation instruction for the FOSUserBundle and configure it to your needs.

Then integrate it with the AdminLTEBundle as follows.

config/packages/admin_lte.yaml

admin_lte:
    routes:
        adminlte_login: fos_user_security_login
        adminlte_login_check: fos_user_security_check
        adminlte_registration: fos_user_registration_register
        adminlte_password_reset: fos_user_resetting_request

If you don't want the "password reset" and/or "register account" functionality, simply remove the configuration keys adminlte_password_reset and adminlte_registration.

Create templates

Create the directory templates/bundles/FOSUserBundle/ with the following directory structure and files:

templates/bundles
└── FOSUserBundle
    ├── Registration
    │   ├── confirmed.html.twig
    │   └── register.html.twig
    ├── Resetting
    │   └── request.html.twig
    ├── Security
    │   └── login.html.twig
    └── layout.html.twig

Now create the files with the following content:

Registration/confirmed.html.twig

{% extends '@AdminLTE/FOSUserBundle/Registration/confirmed.html.twig' %}

Registration/register.html.twig

{% extends '@AdminLTE/FOSUserBundle/Registration/register.html.twig' %}

Resetting/request.html.twig

{% extends '@AdminLTE/FOSUserBundle/Resetting/request.html.twig' %}

Security/login.html.twig

{% extends '@AdminLTE/FOSUserBundle/Security/login.html.twig' %}

layout.html.twig

{% extends '@AdminLTE/FOSUserBundle/layout.html.twig' %}

Overwriting the application name

You might want to overwrite the block logo_login in each file to display your app name like this:

{% block logo_login %}<b>Demo</b><br>Application{% endblock %}

You can have a look at the files in the demo application to get a first idea.