Get Master Data Object Within View?? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Get Master Data Object Within View?? (/showthread.php?tid=32995) |
Get Master Data Object Within View?? - El Forum - 08-11-2010 [eluser]Unknown[/eluser] 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? Thanks, -Nate Get Master Data Object Within View?? - El Forum - 08-11-2010 [eluser]pickupman[/eluser] 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: Code: $this->load->vars($data); //Load $data into any view called Get Master Data Object Within View?? - El Forum - 08-12-2010 [eluser]Unknown[/eluser] You're right! The variables are already there. Thanks so much! -Nate |