Welcome Guest, Not a member yet? Register   Sign In
Loading Views within Views
#1

[eluser]hyeteck[/eluser]
I'm new to codeigniter and the whole MVC concept. I'm trying to test some stuff out and they aren't working out the way i thought they would.

This is the html i have

Code:
<div id="wrapper">
        <div id="container">
            <div id="header"><p>hello</p>&lt;?= $header ?&gt;</div>
            
            <div id="left_menu">&lt;?= $left_menu ?&gt;</div>
            
            <div id="content">&lt;?= $content ?&gt;</div>
            
            <div id="right_menu">&lt;?= $right_menu ?&gt;</div>
            
            <div id="footer">&lt;?= $footer ?&gt;</div>
        </div>
    </div>

and here is the controller class

Code:
&lt;?php
class Content extends Controller {
    
    function index()
    {
        $data['title'] = "This is the title";
        $data['header'] = $this->load->view('header');
        $data['left_menu'] = $this->load->view('left_menu');
        $data['content'] = $this->load->view('about_us');
        $data['right_menu'] = $this->load->view('right_menu');
        $data['footer'] = $this->load->view('footer');
        $this->load->view('template', $data);
    }    
}
?&gt;

i put in the "hello" paragraph in the html before the header is loaded but when the site is loaded, the "hello" text appears at the very end of the page after all the views are loaded. Why is this happening?

thanks


Messages In This Thread
Loading Views within Views - by El Forum - 07-27-2008, 01:00 PM
Loading Views within Views - by El Forum - 07-27-2008, 01:41 PM
Loading Views within Views - by El Forum - 07-27-2008, 01:49 PM
Loading Views within Views - by El Forum - 07-27-2008, 01:51 PM
Loading Views within Views - by El Forum - 07-27-2008, 01:53 PM
Loading Views within Views - by El Forum - 07-27-2008, 02:42 PM
Loading Views within Views - by El Forum - 07-27-2008, 06:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB