【发布时间】:2023-03-14 13:06:02
【问题描述】:
我在通过引用修改 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");
【问题讨论】:
标签: php smarty pass-by-reference