vars($vars[, $val = ''])
Parameters: |
|
---|---|
Returns: |
CI_Loader instance (method chaining) |
Return type: |
CI_Loader |
This method takes an associative array as input and generates variables using the PHP extract() function. This method produces the same result as using the second parameter of the $this->load->view()
method above. The reason you might want to use this method 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 method. You can have multiple calls to this method. The data get cached and merged into one array for conversion to variables.
Please login to continue.