Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] [1.71] Passing data
#7

[eluser]Terry Valladon[/eluser]
If you are only going to use the data in a view you can also call $this->load->vars($array) in your constructor.

Quote: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.

From how you are making use of it ($this->data rather then $this->some_random_var) I am assuming that this is more along the lines of what you want.

I know you said this was SOLVED but wanted to add this in for others who might come across the thread in a search.


Messages In This Thread
[SOLVED] [1.71] Passing data - by El Forum - 08-29-2009, 09:08 AM
[SOLVED] [1.71] Passing data - by El Forum - 08-29-2009, 09:41 AM
[SOLVED] [1.71] Passing data - by El Forum - 08-30-2009, 06:48 AM
[SOLVED] [1.71] Passing data - by El Forum - 09-02-2009, 10:44 AM
[SOLVED] [1.71] Passing data - by El Forum - 09-02-2009, 06:02 PM
[SOLVED] [1.71] Passing data - by El Forum - 09-03-2009, 06:59 AM
[SOLVED] [1.71] Passing data - by El Forum - 09-05-2009, 04:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB