Smarty 2 released – the PHP compiling template engine

Smarty 2 released – the PHP compiling template engine. This release is a huge milestone for Smarty. Most notable new things are a plugin architecture, removal of PEAR dependency, and optimizations that drastically improve the performance (see benchmarks) of Smarty in most cases.

The plugin architecture allows modifiers, custom functions, compiler functions, prefilters, postfilters, resources, and insert functions to be added by simply dropping a file into the plugins directory. Once dropped in, they are automatically registered by the template engine. This makes user-contributed plugins easy to manage, as well as the internal workings of Smarty easy to control and customize. This new architecture depends on the __FILE__ constant, which contains the full path to the executing script. Some older versions of PHP incorrectly gave the script name and not the full filesystem path. Be sure your version of PHP populates __FILE__ correctly. If you use custom template resource functions, the format of these changed with the plugin architecture. Be sure to update your functions accordingly. See the template resource section of the documentation.

If you need a template engine on which to build a high-end content management system, you can't go wrong with this one. We use Smarty ourselves. Well written and blindingly fast with a PHP code caching engine – John  [PHP Everywhere]

Leave a comment