Loading multiple views concurrently - $data array can't be used unless it's loaded in the first! |
[eluser]stormbytes[/eluser]
So, referencing the UG - http://ellislab.com/codeigniter/user-gui...views.html When loading multiple views.. Eg.: Code: $this->load->view( 'header' ); The $data array (variables) are only accessible *after* the load statement which included $data has been 'processed'. Meaning, if you have header elements that depend on $data-variables, you'll get an error. The way I've remedied this is by loading $data into the very first load statement (eg - $this->load->view('header', $data). I'm wondering if this is something the dev team will want to change in the upcoming release of v.2. or if I'm overlooking something? My understanding was that everything is pre-buffered, in which case it shouldn't make any difference what order the Load-statement containing the $data array appears in. Curious to hear thoughts... |
Welcome Guest, Not a member yet? Register Sign In |