Welcome Guest, Not a member yet? Register   Sign In
Get Master Data Object Within View??
#1

[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
#2

[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
#3

[eluser]Unknown[/eluser]
You're right! The variables are already there.

Thanks so much!
-Nate




Theme © iAndrew 2016 - Forum software by © MyBB