views:

47

answers:

1

Hey Guys,

I am having an issue modifying a smarty variable by reference. Here 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");
A: 

Actually nvm, I made a mistake somewhere else in the code. The above code is correct :P

sridawg