Search code examples
phpsmartyprestashopprestashop-1.6

Why is it possibile to access variables in smarty templates with Prestashop?


What is the file (or files) that allow me to access all the variables in Smarty templates written in other PHP files?

I can't find a function to do that.


Solution

  • there's not a file where you find all the smarty variables. To get one (or more) variables instantiated from other files you have to call a smarty method.

    For example, if you have developed a module you have to call:

    $myvar = $this->context->smarty->GetTemplateVars('myvar');