simpleTemplate - a simple templateparser in PHP
In a project of mine I wanted to use a templateparser to easily output some HTML. I started with Smarty; but found it too heavy weighted; with it’s endless list of classes and files I didn’t want. So I continued with TinyButStrong which proclaims to be simple with only one class. Having tried some time I didn’t like it either. It’s code is unreadable to me; and so are the templates. Even worse; it uses blocks instead of arrays; so I needed to define all my arrays as blocks before the templateclass could use it. So I started thinking about creating something myself. As Google can tell you, other people have thought the same thing. I hope you can spot what makes mine better by looking at the code, or just start using it. Anyways, like so many people I think my code might be useful for others.
simpleTemplate supports if-statements, variable getting and setting, foreach-loops, blocks and a simple yet effective caching mechanism. I do have a list of features I am going to add so keep an eye on sjon.blog for any updates to the code. Here it is:
Comments welcome!