MiniTemplator is a compact template engine for HTML files. It's available in Java, PHP and Visual Basic (VB/VBA). It uses a simple syntax for template variables and blocks, supports nested blocks and is implemented as a single code module.
I really recommend MiniTemplator. I used it in VB, PHP and Java Projects. No other templating engine i know of provide the same degree of separation of view and logic. Even loops and conditionals are driven by the host language. Simple and powerful.
was handed a project that uses the php version of this, rewriting large swaths of code to escape the template restrictions is easier than using it. At least if it had a {php}{/php} type thing like smarty it wouldn't be so ungodly painful to use.
New variant of addBlock() added with an isOptional parameter. Conditional blocks ($if statement) implemented. New nested class MiniTemplator.TemplateSpecification. Old constructors replaced by the new general constructor MiniTemplator(TemplateSpecification). Parameter type of generateOutput(String) changed form File to String. Method getVariables() added. New constructor MiniTemplator(String) added. Note that this constructor is not compatible with the old (prior to 2007-05-19) constructor with the same signature, because the old constructor with that signature expected the template string in the string argument instead of the file name. The nested exceptions (MiniTemplator.TemplateSyntaxException, MiniTemplator.VariableNotDefinedException and MiniTemplator.BlockNotDefinedException) are now derived from RuntimeException instead of Exception, to make them unchecked exceptions that do not have to be catched or declared. Convenience methods added: setVariableOpt(String, String), setVariableOptEsc(String, String) and addBlockOpt(String). EPL license added. The complement ("not") operator "!" may now be used in the flag expressions of the $if and $elseif commands.
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?
Thanks for your review!
Get credit for your review by logging in via OpenID. Click your account provider: