Welcome Guest, Not a member yet? Register   Sign In
$this->load->vars()
#2

[eluser]sophistry[/eluser]
from the manual:
Quote:$this->load->vars($array)

This function takes an associative array as input and generates variables using the PHP extract function. This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might want to use this function independently is if you would like to set some global variables in the constructor of your controller and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached and merged into one array for conversion to variables.

i believe that you only get the variables when you are in the view context (view has been "loaded").

if you want to share data through extended classes you should probably use class variables (var $title = 'title here'Wink


Messages In This Thread
$this->load->vars() - by El Forum - 11-19-2008, 12:44 PM
$this->load->vars() - by El Forum - 11-19-2008, 01:10 PM
$this->load->vars() - by El Forum - 11-19-2008, 02:38 PM
$this->load->vars() - by El Forum - 11-20-2008, 06:01 AM
$this->load->vars() - by El Forum - 11-20-2008, 06:17 AM
$this->load->vars() - by El Forum - 11-20-2008, 06:27 AM
$this->load->vars() - by El Forum - 11-20-2008, 07:03 AM
$this->load->vars() - by El Forum - 11-20-2008, 07:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB