From xtpl-announce at phpxtemplate.org Thu Aug 16 21:53:36 2007 From: xtpl-announce at phpxtemplate.org (xtpl-announce@phpxtemplate.org) Date: Thu Aug 16 21:54:05 2007 Subject: [xtpl-announce] New features & Forums Message-ID: <46C4B950.6030802@phpxtemplate.org> Hi All, Quick update about PHP XTemplate activity in the last few months: * Some re-factoring of the website including new discussion forums (got tired of SourceForge on that score) * A major new feature *Tag Callback Functions* - available in the SubVersion source code tree (as from today!): o allows tags like $xtpl->assign('mytag', 'Test text'); + {mytag|my_callback_method} or + {mytag|callbackfunction1|str_replace('text', 'code', %s)#comments} + it's a very powerful feature that encourages some 'intelligence' in the templates without changing the separation of code logic and display too much (as per Smarty et al) o callbacks can be a (limited set of) PHP function(s), your own defined functions or methods within a sub-classed child of XTemplate. o If there's a '%s' in the callback string, the tag is passed in that position to the callback. You don't need to use that notation however as the tag is automatically passed as the only parameter to the callback function in if there's no %s. o PHP 5 version fully operational, PHP 4 version needs testing (as I don't really use it any more!) and reporting on in the forums (http://forum.phpxtemplate.org) o Some recent comments about this new feature: + Really great job anyway! I love it + Those callbacks look like the start of a superb feature. I had wanted something like that for a long time + I just want to say.... thank-you thank-you thank-you for these beautiful callbacks. I've just switched my template wrapper class to use the latest from the SVN... sweeeet lord... * Stable version 0.4.0 released (29/05/07) for both PHP 5 & 4 Anyway that's all for now. $xtpl->assign('message', 'HAPPY TEMPLATING'); {message|strtolower|ucwords} Regards, Jeremy -- PHP XTemplate http://www.phpxtemplate.org/ http://forum.phpxtemplate.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.phpxtemplate.org/pipermail/xtpl-announce/attachments/20070816/13419c3b/attachment.html