0
我遇到了通过引用修改smarty变量的问题。这里是我想要做的事:通过引用修改smarty对象
class foo {
$property;
public function getProperty(){
return $this->$property;
}
public function index(&$smarty){
$smarty->assign('test',$this->getProperty());
}
}
$smarty = new Smarty();
$foo = new foo();
$foo->index($smarty);
$smarty->display("test.tpl");