Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Repetir el contenido de un bloque dentro de una plantilla twig
<!DOCTYPE html>
<meta charset="UTF-8" />
<title>{{ block('title') }} | MyPage</title>
{% block stylesheets %}{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
<meta name="title" content="{{ block('title') }} | MyPage"/>
<h1>{% block title %}Bienvenido a mi blog!{% endblock %}</h1>
{% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
{% extends 'base.html.twig' %}
{% block title %}Usos de la función block en twig{% endblock %}
{% block body %}
{# nuestro contenido #}
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.