Altex
Новичок
Method Overloading (php4)
На выходе
и показывается шаблон template.tpl
Почему метод display вызывается, а assign нет?
PHP:
class Tpl
{
var $mSmarty;
function Tpl()
{
overload(__CLASS__);
require_once dirname(__FILE__).'/lib/smarty/Smarty.class.php';
$this->mSmarty =& new Smarty;
$this->mSmarty->template_dir = dirname(__FILE__)."/tpl";
$this->mSmarty->compile_dir = dirname(__FILE__)."/tpl_c";
}
function __call($method, $args)
{
return call_user_func_array(array($this->mSmarty,$method),$args);
}
}
$tpl =& new Tpl();
$tpl->assign('pl','');
$tpl->display('template.tpl');
Код:
Warning: Call to undefined method tpl::assign() in <skip>test.php on line 27
Почему метод display вызывается, а assign нет?

да.. и я в 4.x.x мучался долго с глючным ООП, причем глюки были очень смешные, особенно с клонированием, невольно вспомнил комедию где ученые сделали машину клонирования предметов и она заглючила когда туда попала овца.