Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try following</p> <p>Folder structure</p> <pre><code>-application --controller ---dashboards.php --views ---layouts ----application.php ---dashboards ----index.php </code></pre> <p>Controller</p> <pre><code>class Dashboards extends CI_Controller { public function __construct() { parent::__construct(); $data = array(); $data['js'] = 'dashboards.js' $data['css'] = 'dashbaord.css' } public function index() { $data = array(); $data['yield'] = 'dashboards/index'; $this-&gt;load-&gt;view('layouts/application', $data); } } </code></pre> <p>View</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="UTF-8" /&gt; &lt;title&gt;Some Title&lt;/title&gt; &lt;link rel="stylesheet" href="&lt;?php echo base_url(); ?&gt;assets/css/app.css" /&gt; &lt;link rel="stylesheet" href="&lt;?php echo base_url(); ?&gt;assets/css/&lt;?php echo $css; ?&gt;" /&gt; &lt;/head&gt; &lt;body&gt; &lt;header&gt;&lt;/header&gt; &lt;section id="container" role="main"&gt; &lt;?php $this-&gt;load-&gt;view($yield); ?&gt; &lt;/section&gt; &lt;footer&gt;&lt;/footer&gt; &lt;script src="&lt;php echo base_url(); ?&gt;assets/js/app.js"&gt;&lt;/script&gt; &lt;script src="&lt;php echo base_url(); ?&gt;assets/js/&lt;?php echo $js; ?&gt;"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>When you need to load different js, css or whatever in the header or footer use the <code>__construct</code> function to <code>$this-&gt;load-&gt;vars</code></p> <p>Kind of a rails like approach here</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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