Smarty: Assigning global variable from controller |
[eluser]behnampmdg3[/eluser]
Hello; I use $this->load->vars($data); in controllers to assign global variables with Codeigniter. For example: Code: if($places) I was wondering what is the equivalent of the code above Smarty. Cause $this->smarty->assign("places", $list_places); does not create global variables! Code: if($places) Thank you
[eluser]Aken[/eluser]
Smarty::assign() is the standard way to assign "global" variables for Smarty. http://www.smarty.net/docs/en/language.v...scopes.tpl If you want to see a way of integrating Smarty but keeping CI-style code (aka $this->load->view()), see my Github Repo: https://github.com/cryode/CodeIgniter_Smarty |
Welcome Guest, Not a member yet? Register Sign In |