Welcome Guest, Not a member yet? Register   Sign In
how to simultate a template with codeigniter
#2

[eluser]Iksander[/eluser]
Controller:

Code:
class Your_Controller extends Controller
{
    function index()
    {
        $this->load->view('template');
    }
}
Template View:

Code:
$this->load->view('header');
$this->load->view('body');
$this->load->view('footer);
Header view:

Code:
<html>
<head>
  <title>My embedded view test</title>
</head>
<body>
  <h1>This is my header heading</h1>
Body view:

Code:
<p>All the main content stuff would go in this view</p>
Footer view:

Code:
<p>Maybe some footer stuff down here, like copyright and what not</p>
&lt;/body&gt;
</hml>


Hope that helps... there is a good tutorial around here somewhere if what I post is not enough. Just do a search for "views within views".


Messages In This Thread
how to simultate a template with codeigniter - by El Forum - 07-02-2007, 11:12 AM
how to simultate a template with codeigniter - by El Forum - 07-02-2007, 12:09 PM
how to simultate a template with codeigniter - by El Forum - 07-03-2007, 03:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB