I’ve been working with PHP for a few months now, and one thing that was brought up to me that I should learn is how to make a template engine. I know there are things like Smarty out there for this, but given I’m trying to improve my own coding ability I felt I should take the time to learn it.
For the most part, I’ve gotten it down. However, there’s one thing I’ve not been able to figure out that I’ve seen done: how to use a piece of a template file repeatedly on a single page.
I know this function is doable, as I’ve been trying to use phpBB as a basis for my learning and THEY do this when you’re viewing a topic: all the posts use a small portion of the viewtopic_body.html template file over and over for each post. What I’m trying to figure it is how I can do this as well. I’ve spent a while now reading over their files, following from one function to the other and trying to find the right function, but I’ve not found what I need (Or if I have, I was too confused by it to recognize it).
Can anyone give me an idea of how I can do this?