Anyone here know where to find a decent tutorial for writing a template engine in php using mysql? I've found two but I'd like to look at a couple more.
Id recommend using an off the shelf solution, there are many out there... one that we have used for projects at work is: http://www.twig-project.org/
Otherwise you are looking at writing advanced regular expression and debugging it, it is obviously possible but twig is really optimized for speed. I will say however the code isn't as elegant as it could be.
I would then advise you tear apart some of the standard templating systems available like smarty and twig to get understanding of where they are going.
There are a few steps: template, parsing the template and interpolate variables, caching
You may also want to include syntax for sub templates and how this is handled too.
Bookmarks