php function call
| From: | JM | Date: | Tue, 26 Jul 2005 20:39:14 +0000 |
| Subject: | php function call | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12869@lists.php.net to get a copy of this message | ||
Ok I have a group of Smarty variable assignments that I want to put in
a php function so I can call it at various points in the script.
However, it's not returning any data when I call the function. Any
ideas?
<?php
function meat($obj)
{
$obj->assign('template_var1', $var1);
$obj->assign('template_var2', $var2);
return $obj;
}
// Smarty setup and object blah blah
$template = "page.htm";
$var1 = "yes";
$var2 = "no";
meat($obj);
$smarty->display($template);
?>