![]() |
Losing $data inside views that have been included by another view, think it's HMVC related. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Losing $data inside views that have been included by another view, think it's HMVC related. (/showthread.php?tid=56247) |
Losing $data inside views that have been included by another view, think it's HMVC related. - El Forum - 12-05-2012 [eluser]boltsabre[/eluser] Hi everyone, got a problem, I've lost my $data array inside views that have been included by other views. Code: //This is a view, let's call it main: Code: // And the view loaded by the above view, called search.php This has me completely stumped, but think it's got something to do with HMVC and upgrading from CI version 2.0.2 to 2.1.3... The strange thing is that variables loaded by $this->load->vars($data); inside my MY_Controller are working in "sub" views, but $data variables defined in a normal controller are not. Here is MY_Controller code just in case it adds any insights... Code: <?php (defined('BASEPATH')) OR exit('No direct script access allowed'); Anyone got any ideas what could be causing this strange behavior...??? Losing $data inside views that have been included by another view, think it's HMVC related. - El Forum - 12-05-2012 [eluser]boltsabre[/eluser] Hmmmm, not looking good... I've checked it out, looks like the load function in MX_Loader (line 253) Code: /** Load a module view **/ So I can get around this issue by passing it in, in my view such as this: Code: <div class="twoColDivTwo"> BUT BUT BUT this is NOT how it's meant to work. It's been a hard day of debugging this crap, need to hit the sack now, but if ANYONE has an idea or can point me in the right direction I'd be extremely grateful. Thanks. |