Download

Changed unit tests to use current PHPUnit from http://www.phpunit.de/ rather
than old unsupported one from http://pear.php.net/

Implemented parts of request #12221 (thanks to Carsten Wiedmann for ideas and
their initial implementation)
* It is now possible to add comments to the template file that are removed
from output: <!-- COMMENT --> ... <!-- /COMMENT -->
* Added new builtin callbacks 'e' and 'r' for htmlentities() and
rawurlencode(), respectively
* Added the 'charset' option for builtin 'h' and 'e' callbacks

Download

Fixed bug #6346: typo in _buildFunctionList()
Fixed bug #6902: correctly handle drive letters and path separators on Windows
Fixed bug #6905: use 'b' modifier for fopen() to prevent problems with cached templates on Windows
Calling setCacheRoot() with an empty argument will now disable caching. It was impossible
to disable it with previous behaviour.

Added possibility to pass arrays as second arguments to setVariable() and setGlobalVariable(),
this will assign values to placeholders of the form {varName.arrayKey} in the template.
Thanks to Franz Pentenrieder <franz at quox.net> for idea and original implementation.

Download

Changed the code for parsing template function arguments. It will
now correctly unescape the escaped quotes within quoted arguments
(see bug #1840).
The new code throws errors on bogus arguments. If you previously
relied on undocumented behaviour of argument parsing method, your
code may break: test before upgrading.

Download

* Added getBlockList() and getPlaceholderList() methods (thanks to Markus Wolff for the idea).
* HTML_Template_IT compatibility: get() does not clear the parsed block contents by default.
* Removed obsolete docs, current ones are in the PEAR manual.

Download

This release has Sigma's template functions/callbacks infrastructure significantly enhanced.
This unfortunately means some backwards compatibility breaks. If you were using callbacks before, please carefully examine the release notes and test you scripts before upgrading to 1.0.
If you weren't using callbacks due to their shortcomings it is a good time to give them a try, consult docs/example_4.php for some of their possible applications.

Template functions/callbacks changes and incompatibilities:

* Templates are parsed for function calls not only on setTemplate()/loadTemplatefile(), but on addBlock()/addBlockfile() and replaceBlock()/replaceBlockfile() as well.
* The arguments to template functions can now contain variable placeholders: func_uppercase('Hello, {username}!).
* Template functions are now compatible with template caching.
* Method setCallbackFunction() now accepts a callback that is compatible with call_user_func() as its second argument. Its third argument is used to control variable substitution in function arguments.
* Method performCallback() was removed. Callbacks are now called automatically when the block containing them is parse()'d.
* Callbacks are now called via call_user_func_array() instead of call_user_func(). This makes it possible to use built-in functions as callbacks, but also means that you have to rewrite your old functions!
* Usage example is available in docs/example_4.php

Download

* Added usage examples
* Added the cache FAQ
* This is the last 0.9.x release unless some bugs are found. The 1.0 release will
have callbacks significantly redone and will require changes to your scripts if
you use callbacks.