SonataUserBundle覆盖用户配置文件


SonataUserBundle override user profile

我想覆盖我的用户仪表板[profile show.html]。但我不知道该怎么做。有人可以解释我或给我看他的代码,所以我可以有一个想法,他是如何做到的。

this is my show.html.twig:

{% extends "SonataUserBundle:Profile:action.html.twig" %}
{% block sonata_profile_content %}
    {% sonata_template_box 'This is the user profile template. Feel free to override it.' %}
    <div class="row row-fluid">
        {% set has_center = false %}
        {% for block in blocks %}
            {% if block.position == 'center' %}
                {% set has_center = true %}
            {% endif %}
        {% endfor %}
        <div class="{% if has_center %}span4 col-lg-4{% else %}span6 col-lg-6{% endif %}">
            {% for block in blocks %}
                {% if block.position == 'left' %}
                    {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
                {% endif %}
            {% endfor %}
        </div>
        {% if has_center %}
            <div class="span4 col-lg-4">
                {% for block in blocks %}
                    {% if block.position == 'center' %}
                        {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
                    {% endif %}
                {% endfor %}
            </div>
        {% endif %}
        <div class="{% if has_center %}span4 col-lg-4{% else %}span6 col-lg-6{% endif %}">
            {% for block in blocks %}
                {% if block.position == 'right' %}
                    {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
                {% endif %}
            {% endfor %}
        </div>
    </div>
{% endblock %}

谢谢。

你可以在app/Resources/SonataUserBundle/views/Profile/show.html.twig.

必须清除结尾的缓存