The docs say quite specifically that Twig doesn't support multiple inheritance - more than one extends per render, yet it seems to support exactly that, both in 1.x and 2.x.
The Symfony docs even recommend this approach as the "common way" to manage structuring templates.
Is the Twig documentation out of date or am I missing something here?
Looks like you are misunderstanding the term of multiple inheritance.
In some programming languages you can have something like this (this code will not work with PHP):
class ClassA {}
class ClassB {}
class ClassC extends ClassA, ClassB {} #ClassC extends two classes
So the hierarchy is as follows (arrows show direction from base class to child):
ClassA ↘
ClassC
ClassB ↗
But in linked Symfony docs you will get the following hierarchy:
base.html.twig -> blog/layout.html.twig -> blog/index.html.twig
This is simple chained hierarchy, without multiple inheritance.
Read things twice, Dan, always read things twice.
Thanks for the explanation, much appreciated.
Most helpful comment
Looks like you are misunderstanding the term of multiple inheritance.
In some programming languages you can have something like this (this code will not work with PHP):
So the hierarchy is as follows (arrows show direction from base class to child):
But in linked Symfony docs you will get the following hierarchy:
This is simple chained hierarchy, without multiple inheritance.