Hey guys/gals...
I've looked over phpBB's templating system, and still tough to wrap my head around it. I would love for some help (if you can). Basically, I want to make my next site work like so:
1.) PHP grabs the template file that is needed to display the requested information
2.) PHP looks for tags of the type "<!-- BEGIN some_unknown_function -->" and "<!-- END some_unknown_function -->"
3.) All HTML/template code in between there will be parsed according to the "some_unknown_function"
4.) PHP searches for actual tags & replaces them (<-- That one I know how to do)
I can do basically most of it, except the whole looping or executing code issue. Here's where your help will come in. NOTE: I am going to post this over at phpBB forums, but figure I might get a more pleasant response here. How would one go about implementing something like this? Like if I wanted one section to be repeated over and over as part of the query, but yet keep the PHP separate from the HTML/Template?
Here's a small example of what I'd want:
<html>
<!-- Some other code that is currently removed for space -->
<body>
<div id="main">
<div id="content">
<!-- BEGIN mySQL_Loop -->
<div class="item">
<div class="title">{itemTitle}</div>
<p class="cont">{itemContent}</div>
</div>
<!-- END mySQL_Loop -->
</div>
</div>
</body>
</html>
So how would one go about doing that? I've opened up the "template.php" file in the phpBB distribution, but get lost when they start talking about blocks, and levels. Can anyone shed light on this? Or perhaps point me in the direction of a tutorial that actually explains how to create this type of a templating system?
Thanks for any help you can offer.
~Brett