Jump to content

$smarty VS $this->smarty


Recommended Posts

Can someone explain me why according to many tutorials when I want to assign variable to hook I should do like this:

 
for example inside the public function hookHeader()
 
$this->smarty->assign(array(
    'myvariable' => 'mytext'
));

 

but it doesn't works for me BUT works for me when I make like this:

 

global $smarty;
$smarty->assign(array(
    'myvariable' => 'mytext'
));
 
Any ideas?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...