Welcome Guest, Not a member yet? Register   Sign In
Navigation with links from db. How?
#5

[eluser]deck1[/eluser]
You can use something like this:

In your controller:

Code:
$this->load->library('layout');

//instead of this->load->view
$this->layout->display('your_main_content_view', $data);

application/libraries/Layout.php:
Code:
<?php  

class Layout
{

    var $CI;

    function Layout()
    {
        $this->CI =& get_instance();
    }

    function display($view, $data=NULL)
    {
        //Header with menu from DB
        $data_header['top_menu'] = 'Menu from DB...';
        $this->CI->load->view('header_view', $data_header);
        
        //Main content
        $this->CI->load->view($view, $data);
        
        //Footer
        $data_footer['bottom_menu'] = 'Menu bottom';
        $this->CI->load->view('footer_view', $data_footer);
    }
}
?>


Messages In This Thread
Navigation with links from db. How? - by El Forum - 04-15-2008, 05:06 AM
Navigation with links from db. How? - by El Forum - 04-17-2008, 01:11 AM
Navigation with links from db. How? - by El Forum - 04-17-2008, 01:23 AM
Navigation with links from db. How? - by El Forum - 04-17-2008, 02:23 AM
Navigation with links from db. How? - by El Forum - 04-17-2008, 01:56 PM
Navigation with links from db. How? - by El Forum - 04-21-2008, 08:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB