I try to develop my own little framework. For this, I'd like to read up some templating techniques. I know that templating is a really complex topic, but knowing some strategies could help find the right one.
Please, if you mention one, don't just write "smarty" for example. Write a little about the concept behind it.
Let me start with an idea: To make things simple, my template files are just PHP files that contain HTML. Templates may include other templates. The data is inserted into the templates through a $data variable, which is an associative array containing all the data for the template.
So, at the first stage a controller performs some action and builds up that $data array. Next, the appropriate template will be included.
Problems: A Template might have to include not only templates, but also controllers. i.e. displaying a breadcrumb or menu (with fairly complex logic behind, far too complex to be handled in a template).