I am having an issue modifying a smarty variable by reference. H开发者_如何学运维ere is what I am trying to do:
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");
Actually nvm, I made a mistake somewhere else in the code. The above code is correct :P
精彩评论