Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As Sean said, if the functionality is at Controller level you should extend CI_Controller. May be some functionality should be at view level, so a loader view can be used to help you keep the global layout of every page and include the common features. that's something like:</p> <p>[view] layout.php:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es"&gt; &lt;head&gt; &lt;?php $this-&gt;load-&gt;view('meta', $data); ?&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="wrapper"&gt; &lt;?php $this-&gt;load-&gt;view('header', $data); ?&gt; &lt;div id="contents"&gt; &lt;?php include ('menu_izq.php'); ?&gt; &lt;div id="page"&gt; &lt;?php $this-&gt;load-&gt;view($page, $data); ?&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="clear: both;"&gt;&lt;/div&gt; &lt;?php $this-&gt;load-&gt;view('footer');?&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>In your controller you should always load this view and pass in the parameter array the value of the contents real view, like in </p> <pre><code> $data['page'] = 'incidents'; // this is the real contents $stylesheets[] = '/scripts/jscalendar-1.0/skins/aqua/theme.css'; $data['stylesheets'] = $stylesheets; $scripts[] = '/scripts/jscalendar-1.0/calendar.js'; $scripts[] = 'https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'; $scripts[] = '/scripts/autoNumeric-1.4.1.js'; $scripts[] = '/scripts/autoLoader.js'; $data['scripts'] = $scripts; $this-&gt;load-&gt;view('container',$data); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload