Template Inheritance

Hi guys.

Speaking about default php engine, what’s the best way to implement “template inheritance” (some places in layout can be overwritten in the view).

What do you mean?

Themes or else?..

No, I’m talking about inheritance (many frameworks and template engines have this, so I was pretty sure there will be no questions).

Here’s the description from Smarty: http://www.smarty.net/inheritance

I haven’t dug deep enough into the Yii 2 source to adequately answer this, but: In Yii 1, you could achieve roughly the same by overwriting clips. Perhaps this is also possibly in Yii 2?

Yes, there are ‘blocks’, but maybe I’m using them wrong, so just wanted to know if there’s a “right” way.

Hm, can’t really answer that. Sometimes, there is such a thin line between “clever hack” and “outright abuse” … :unsure: