Welcome Guest, Not a member yet? Register   Sign In
HMVC and Libraries
#1

[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


Messages In This Thread
HMVC and Libraries - by El Forum - 08-25-2009, 01:40 PM
HMVC and Libraries - by El Forum - 08-26-2009, 01:28 PM
HMVC and Libraries - by El Forum - 08-28-2009, 02:11 PM
HMVC and Libraries - by El Forum - 08-30-2009, 01:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB