CodeIgniter Forums
HMVC and Libraries - 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: HMVC and Libraries (/showthread.php?tid=21961)



HMVC and Libraries - El Forum - 08-25-2009

[eluser]Stylec[/eluser]
Hi,

I have a Layout library that I got from the WIKI. I have just upgraded to the latest HMVC Modular Extensions (5214). For some reason the Layout library is not using the load view function from the new MX_Loader and therefore cannot find the view file in the modules folder.

Any ideas?

Layout Library

Code:
<?php  
if (!defined('BASEPATH')) exit('No direct script access allowed');

class Layout
{
    
    var $obj;
    var $layout;
    
    function Layout($layout = "layout_main")
    {
        $this->obj =& get_instance();
        $this->layout = $layout;
    }

    function setLayout($layout)
    {
      $this->layout = $layout;
    }
    
    function view($view, $data=null, $return=false)
    {
        $data['content_for_layout'] = $this->obj->load->view($view,$data,true);

        if($return)
        {
            $output = $this->obj->load->view($this->layout,$data, true);
            return $output;
        }
        else
        {
            $this->obj->load->view($this->layout,$data, false);
        }
    }
}
?>

Thanks Stylec


HMVC and Libraries - El Forum - 08-26-2009

[eluser]Stylec[/eluser]
It looks like its all libraries that do not have access to the modular extentions MX_Loader. Is this normal?


HMVC and Libraries - El Forum - 08-28-2009

[eluser]Josepzin[/eluser]
Any solution? I have the same problem...


HMVC and Libraries - El Forum - 08-30-2009

[eluser]Stylec[/eluser]
[quote author="Josepzin" date="1251508280"]Any solution? I have the same problem...[/quote]

I've had to revert back to an old version 4.2.06 (2008-07-19) that uses a helper file to fix my problem, not the solution I wanted but at least it now works.