Answer the question
In order to leave comments, you need to log in
Why doesn't {% parent %} work?
Why does it show this?
Uncaught exception 'Twig_Error_Syntax' with message 'Unexpected tag name "parent" (expecting closing tag for the "block" tag defined near line 3) in "view_post.tpl" at line 5' in /var/www/mamonov/vendor/twig /twig/lib/Twig/Parser.php:177 Stack trace: #0 true) #1 /var/www/mamonov/vendor/twig/twig/lib/Twig/Parser.php(191)...
<!DOCTYPE html>
<html>
<head>
{% block head %}
<link rel="stylesheet" href="">
<meta charset="utf-8">
{% endblock %}
</head>
<body>
<header>
<ul>
<li>link</li>
<li>link</li>
<li>link</li>
<li>link</li>
<li>link</li>
</ul>
</header>
<main>
{% block main %}
{% endblock %}
</main>
<footer>
© 2015 Matthew Mamonov
</footer>
</body>
</html>
{% extends "glob/glob.tpl" %}
{% block head %}
{% parent %}
<title>{{ name }}</title>
{% endblock %}
{% block main %}
<h1>{{ name }}</h1>
<p>{{ content }}</p>
<div>
<span>{{ author }}</span> <span>{{ date|upper }}</span>
</div>
{% endblock %}
Answer the question
In order to leave comments, you need to log in
{{ parent() }}
because function:
twig.sensiolabs.org/doc/functions/parent.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question