user7430779
user7430779

Reputation: 47

Twig_Error_Syntax :cannot extend from a block

when I try to extends in twig I have this error I did not understand it . Is there any one know what is mean ?enter image description hereean

Upvotes: 0

Views: 261

Answers (1)

Matias Kinnunen
Matias Kinnunen

Reputation: 8550

Do you have that {% extends 'base.html.twig' %} inside a block? I.e. something like this:

{% block myBlock %}

... code ...

{% extends 'base.html.twig' %}

... code ...

{% endblock %}

Because that would throw a Twig_Error_Syntax exception with the message "Cannot extend from a block." This can be seen in Twig's source code: Extends.php, line 27 and parent_in_a_block.test.

Upvotes: 1

Related Questions