I haven't got a chance to think about this problem seriously. Lately i
am building a cms service app
and it is still one of the design decision i haven't got a good
solution yet.
The way i would do it will be following hack
$template = "{% extends '{$parent_template}' %}\n" . file_get_contents
("${tempate}.html");
H2o::parseString($template)->render($awesome);
I actually want to hear your opinion on this
For a system used by more of designers and less hardcore developers,
"template inheritance vs inclusion" which is easier for them to
understand,
Inclusion (2 phase rendering, render inner template then assign it to
content_for_layout for outter template)
<html>
<head><title>{% block title %}{{ page.title }} {%endblock%}</title></
head>
<body>
{{ content_for_layout }}
</body>
</html>
Or inheritance
<html>
<head><title>{% block title %}{{ page.title }} {%endblock%}</title></
head>
<body>
{% block body %}
{% endblock %}
</body>
</html>
Given that both options can build in a way user can select what parent
or layout to use for a page, what do u think?
Cheers