Copyright © 2008 - 2012 BestSites.ro Team; Partners: websites-development.com
BestSites.ro » Articles » How to access Smarty variables from PHP
31.10.11

How to access Smarty variables from PHP

In most cases Smarty tags will be sufficient, but when you need a quick and dirty solution in the template, this is the way to access the variables stored in the smarty object:

{php}

$myVariable = $this->get_template_vars('myVariable');// get from smarty
// do your thing with $myVariable in PHP
$this->assign('myVariable', $myVariable);// overwrite smarty var 

{/php}

Comments are closed.