Callback in ITX templates
| From: | Steen Rabøl | Date: | Thu, 26 Sep 2002 22:24:28 +0000 |
| Subject: | Callback in ITX templates | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-2391@lists.php.net to get a copy of this message | ||
Hi
How does the callback functions works in ITX
------ template -----
<table>
<tr>
<td>func_h1('H1 Headline')</td>
</tr>
<tr>
<td>Some text</td>
</tr>
</table>
------ template -----
------ php -----
<?php
require_once("../header.inc.php");
$tpl = new IntegratedTemplateExtension($root_path . "templates/");
$tpl->loadTemplateFile("annoncering.html");
function h_one($args)
{
return sprintf('<h1>%s</h1>', $args[0]);
}
$tpl->setCallbackFunction('h1', 'h_one');
$tpl->performCallback();
$tpl->show();
?>
------ php -----
the above gives the following error:
Notice: Undefined variable: args2 in
c:\www\kostplanen\www\include\pear\HTML\ITX.php on line 590
Notice: Uninitialized string offset: 0 in
c:\www\kostplanen\www\include\pear\HTML\ITX.php on line 591
Notice: Uninitialized string offset: 0 in
c:\www\kostplanen\www\include\pear\HTML\ITX.php on line 591
Any hint ?
Thanks in advance.
Steen