[PHPTAL] phptales implementation
lbedubourg
lbedubourg at motion-twin.com
Tue Feb 13 09:31:15 CET 2007
Rick Jolly wrote:
> Hello,
>
> I would like to know how to register a custom modifier. Where would I
> put the function and how would I make it available from my template?
>
> I am currently getting the following error:
> 'Unknown phptal modifier selectc function phptal_tales_selectc does not
> exists' in...
Hi Rick,
You can also create a Template.php file in your project which would look
like that :
<?php
require_once 'PHPTAL.php';
function phptal_tales_selectc($expression, $nothrow=false){
// ...
}
?>
Then, in your program, instead of requiring PHPTAL.php, just require
Template.php and you'll be sure that your custom modifiers are
available to PHPTAL.
Concerning the way tales modifiers can be created, see section 7 of the
PHPTAL documentation :)
Regards
Laurent
More information about the PHPTAL
mailing list