CIA.vc
Archived Message
for PHP XTemplate
Stats » Projects » PHP XTemplate » Archived Message
envelope
Received 20:09 on Aug 16, 2007
Generated by Python Subversion client for CIA version 1.20
linksUTC clock
05:12 on Feb 13, 2012

Commit Message

Author:cocomp
Project:PHP XTemplate
Revision:25
Changed Lines:644
URL:http://xtpl.svn.sourceforge.net/xtpl/?view=rev&rev=25

  • r25 | cocomp | 2007-08-16 21:09:00 +0100 (Thu, 16 Aug 2007) | 29 lines * Backport from PHP 5 version changes - untested, need feedback in the forums * http://forum.phpxtemplate.org/ * * Re-factored tag callback code - improve functionality: * Now can call {tag|callback1} {tag|callback2} {tag|callback1#With a * comment} to get different output for each (thanks again for the * feedback Oliver) * * Further fix for $_SESSION being empty when used with XTemplate::scan_globals() - monitor & feedback if you experience side-effects * Added XTemplate::comment_delim defaults to '#' * Added XTemplate::callback_delim defaults to '|' * Tag callback functions - improve security (thanks Oliver): * Added XTemplate::allow_callbacks property (boolean) to allow switching functionality off * Added XTemplate::allowed_callbacks (array) to limit functions available from templates * Callbacks now only available for methods of subclasses of XTemplate or as functions in XTemplate::allowed_callbacks array * * Fix for $_SESSION being empty when using scan_globals method in certain situations * Changes to regular expressions: Now use definable delimiter throughout code $preg_delimiter, defaults to ` (backtick) * Support top bit set characters x7f-xff in file, block and tags * Major new feature: tag callback functions - allow calling of (mutiple) PHP methods (in XTemplate or it's subclasses) or * functions from within a tag prior to output using | (pipe) as delimiter. See ex9.php * contents of tag are sent as a parameter to the callback function or method. NB. Methods take priority over same named function * e.g. {tagname|callback_function} for simple single parameter callback, tag contents passed as only parameter to callback. * e.g. {tagname|callback_function('param1', 'param2', %s)} to allow mutiple parameters to be specified, %s replaced by tag contents. * Real world chaining callbacks together: * e.g. {tagname|str_replace('Hello World', 'Welcome to the Jungle', %s)|strtolower|ucwords|my_user_callback_func} * (Inspired by sf feature request #1756946 christophe_lu) * Altered debug code in text method to cater for situations when $tpldir may be an array

Modified Files