Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overriding Default FOSUserBundle Templates

Tags:

symfony

Replacement of the template of the FOS does not work well. Cause I'm having problems you do not know. It can be seen better, please tell me.

MyBundle.php

class MyBundle extends Bundle {

    public function getParent() {
        return 'FOSUserBundle';
    } 
}

MyBundle\Resources\FOSUserBundle\views\Security\login.html.twig

{% extends "FOSUserBundle::layout.html.twig" %}

{% block fos_user_content %}
{% if error %}
    <div>{{ error|trans({}, 'FOSUserBundle') }}</div>
{% endif %}

{% block title %}Demo Login{% endblock %}

{% block content %}
    {% block fos_user_content %}{% endblock %}
{% endblock %}


{% endblock fos_user_content %}

vendor \ friendsofsymfony \ user-bundle \ FOS \ UserBundle contents of the \ Resources \ views \ Security of login.html.twig are displayed.

like image 379
village Avatar asked Nov 11 '14 02:11

village


1 Answers

Put your file in app directory

app\Resources\FOSUserBundle\views\Security\login.html.twig

And clear cache.

like image 129
repincln Avatar answered Oct 30 '22 17:10

repincln