How to pass all view vars (not only controller data) to another nested view

#1
[eluser]niverin[/eluser]
Hi,

please help me with this issue!

Example:

main_view.php
Code:
$some_var = "asdlkj";
$next_var = "yxclkjasd";
$another_var = "yxlckj";
//...and many other vars, maybe I will add some or remove...

$this->load->view("nested_view");

What I want is to access all parent view variables (not only controller data) in nested_view.php without manually putting them all to $data[] (don't want to change preceding code and look for all variables that are necessary to pass).

So my question - is it possible to automatically create an array of all this view variables to pass it?

The only method that works for me is to use include(), but you understand I would like to avoid this.


Thanks for help!


Messages In This Thread
How to pass all view vars (not only controller data) to another nested view - by El Forum - 05-23-2009, 05:08 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.