t3[0one]
Новичок
Класс в классе party II
Два класса 1 smarty второй что то типа:
index.php
просто использую эту функцияю
index.tpl
ошибка
Fatal error: Smarty error: [in index.tpl line 5]: [plugin] unknown tag - 'module'
получается что
$this->template->register_function("module", "module_inc");
function module_inc(){
return $this->name ;
}
выполняется но не передаётся наружу (((
Вопрос как сделать так что бы register_function смарти класса передавалась index.php а не оставалась внутри класса cldb
помагите пжлс!
Два класса 1 smarty второй что то типа:
PHP:
<?
class cldb
{
var $template;
var $name = '';
function cldb($template,$name)
{
$this->template = $template;
$this->name = $name;
}
function tester(){
$this->template->register_function("module", "module_inc"); //строка 109
function module_inc(){
return $this->name ;
}
}
}
?>
просто использую эту функцияю
PHP:
//создал класс smarty
$lib = new cldb($smarty,"test");
$lib - >tester();
$smarty->display("index.tpl");
PHP:
....
{module}
....
Fatal error: Smarty error: [in index.tpl line 5]: [plugin] unknown tag - 'module'
получается что
$this->template->register_function("module", "module_inc");
function module_inc(){
return $this->name ;
}
выполняется но не передаётся наружу (((
Вопрос как сделать так что бы register_function смарти класса передавалась index.php а не оставалась внутри класса cldb
помагите пжлс!