A
A
A_Lincoln2019-03-19 23:00:15
Twig
A_Lincoln, 2019-03-19 23:00:15

How to change data in Twig parent template from child?

Hello. How to change title block of header.twig template via page.twig?
header.twig file

-- навигация

{% block title %}{% endblock %}

layout.twig file
{% include 'header.twig' %}

{% block content %}{% endblock %}

page.twig file
{% extends 'layout.twig' %}

-- Как здесь хочу менять блок title из header.twig ? --

{% block content %}
контент
{% endblock %}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
@
@gen, 2019-04-04
_

Try this extension: https://github.com/rybakit/twig-deferred-extension .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question