[eluser]nhm tanveer hossain khan (hasan)[/eluser]
hi,
we have solved this problem on our project without using any other libraries.
we kept "templates" directory under views. where we are keeping layout related design.
check out our base-template-1.php which is used for rendering the common layout.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<?= $this->load->view('common/top_header') ?>
<body>
<div id="wrapper" >
<div id="masthead">
<div class="logo"></div>
<div class="headcont">
<?= alt_site_url() ?>
<?= $this->load->view('common/menu') ?>
</div>
<!-- END: headcont -->
<div class="seperater"></div>
</div>
<!-- END: masthead -->
<!-- loading status panel -->
<?= $this->load-view("common/message") ?>
<? if (is_authenticated() && !isset($no_activity_update_panel)): ?>
<?= $this->load->view('.... some other stuffs ....') ?>
<? endif; ?>
<!-- base content area -->
<div id="content">
<? if (!empty($content_src)): ?>
<?= $this->load->view($content_src); ?>
<? endif; ?>
</div>
<!-- ends base content area -->
</div>
<? $this->load->view('common/analytics')?>
</body>
</html>
example usages from the controller action -
Code:
// send view the list of retrieved result
$data = array(
"items" => $items,
"content_src" => "search/index"
);
// render search result
$this->load->view("templates/base-template-1", $data);
hope that would help.
best wishes