Download SIREN is a base PHP library to do templating in one go.
It has a simple, sufficient API, performs recursive replacement, and uses an intuitive syntax. That's all you need.
syntax: {[$|?]var} where var is [text]{var}[text]
where text is '-._[\w\d\]'
SIREN features a (key, value) array of variables and exercises PCRE patterns to parse text. The library supports recursion, including files and processing of blocks.
Release 1.
Allows setFile to refresh the var.
Added the (internal) vars templateLocation and debugInfo.
Added Global Variables: varNames starting with '$'.
Release 2.
Added setVardata() to escape its value from parsing.
Introduced recursionDepth, default is 'auto'.
Allow recursionDepth manipulation.
Added conditional varValues: varNames starting with '?'.
More documentation: full readme, howto use recursion, api docs, license.
|