[eluser]skunkbad[/eluser]
Yeah, because it works
Code:
// Controller method
public function page()
{
$this->load->model('the_model');
$data = array(
'header' => $this->the_model->get_header(),
'body' => $this->the_model->get_body(),
'footer' => $this->the_model->get_footer()
);
$this->load->view('template', $data);
}
// Model
class The_model extends CI_Model{
public function get_header()
{
return 'Here goes the Header content';
}
public function get_body()
{
return 'Here goes the Body content';
}
public function get_footer()
{
return 'Here goes the Footer content';
}
}
// Template view (/application/views/template.php)
<html>
<head>...</head>
<body>
<?php
echo $header;
echo $body;
echo $footer;
?>
</body>
</html>