Get Master Data Object Within View??

I'm working on a project that includes nested views (views loaded within other views) and I want to pass all the data passed to View1 from the controller to View2 when it loads. Is it possible to access that data object from within View1?


This is the default behaviour in CI. When ever you pass data to a view, CI will cache that object/array and each sub(nested) view will use it the same way.

Also if you are looking to pass data in view from anywhere including constructors, you can use:
$this->load->vars($data); //Load $data into any view called

You're right! The variables are already there.

Thanks so much!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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