village
village

Reputation: 85

Overriding Default FOSUserBundle Templates

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.

Upvotes: 6

Views: 7556

Answers (1)

repincln
repincln

Reputation: 2049

Put your file in app directory

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

And clear cache.

Upvotes: 9

Related Questions