 <p>in advance, you can through this way to build your view:</p> <p><strong>first</strong> create an Template in your view folder</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8"&gt; &lt;meta content="MajidGolshadi" name="author"&gt; &lt;?php echo $html_head; ?&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="content"&gt; &lt;?php echo $content; ?&gt; &lt;/div&gt; &lt;div id="footer"&gt; &lt;?php echo $html_footer; ?&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>second</strong> create an library to load your view automaticaly</p> <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Template { private $data; private $js_file; private $css_file; private $CI; public function __construct() { $this-&gt;CI =&amp; get_instance(); $this-&gt;CI-&gt;load-&gt;helper('url'); // default CSS and JS that they must be load in any pages $this-&gt;addJS( base_url('assets/js/jquery-1.7.1.min.js') ); $this-&gt;addCSS( base_url('assets/css/semantic.min.css') ); } public function show( $folder, $page, $data=null, $menu=true ) { if ( ! file_exists('application/views/'.$folder.'/'.$page.'.php' ) ) { show_404(); } else { $this-&gt;data['page_var'] = $data; $this-&gt;load_JS_and_css(); $this-&gt;init_menu(); if ($menu) $this-&gt;data['content'] = $this-&gt;CI-&gt;load-&gt;view('template/menu.php', $this-&gt;data, true); else $this-&gt;data['content'] = ''; $this-&gt;data['content'] .= $this-&gt;CI-&gt;load-&gt;view($folder.'/'.$page.'.php', $this-&gt;data, true); $this-&gt;CI-&gt;load-&gt;view('template.php', $this-&gt;data); } } public function addJS( $name ) { $js = new stdClass(); $js-&gt;file = $name; $this-&gt;js_file[] = $js; } public function addCSS( $name ) { $css = new stdClass(); $css-&gt;file = $name; $this-&gt;css_file[] = $css; } private function load_JS_and_css() { $this-&gt;data['html_head'] = ''; if ( $this-&gt;css_file ) { foreach( $this-&gt;css_file as $css ) { $this-&gt;data['html_head'] .= "&lt;link rel='stylesheet' type='text/css' href=".$css-&gt;file."&gt;". "\n"; } } if ( $this-&gt;js_file ) { foreach( $this-&gt;js_file as $js ) { $this-&gt;data['html_head'] .= "&lt;script type='text/javascript' src=".$js-&gt;file."&gt;&lt;/script&gt;". "\n"; } } } private function init_menu() { // your code to init menus // it's a sample code you can init some other part of your page } } </code></pre> <p><strong>third</strong> load your library in every controller constructor and then use this lib to load you view automatically</p> <p>to load additional js in your view you can use <code>addJS</code> method in this way:</p> <pre><code>$this-&gt;template-&gt;addJS("your_js_address"); </code></pre> <p>for Css:</p> <pre><code>$this-&gt;template-&gt;addCSS("your_css_address"); </code></pre> <p>and to show your page content call your view file with <code>show</code> method</p> <pre><code>$this-&gt;template-&gt;show("your_view_folder", "view_file_name", $data); </code></pre> <p>i hope this codes help you</p>