title: Codeigniter 3.x - Preload $data to ALL views alongside dynamic data
body: <h2>Question:</h2>
  
  <p>Out of curiosity, I'm wondering if Codeigniter provides a way to have specific data always loaded into a view.</p>
  
  <p>For example: I have a config file that contains site information that would be beneficial to have access to inside of a view for all pages, rather than having to call to load that data every time a load a view, could I always have it included?</p>
  
  <hr>
  
  <pre><code>&lt;?php
      //Standard way
      function index() {
  
          $this-&gt;load-&gt;config('site_settings', true);
          $data['config'] = $this-&gt;config-&gt;item('site_settings');
          $data['fizz'] = 'buzz';
  
          $this-&gt;load-&gt;view('index', $data);
      }
  
      //Way I'd like to see
      function index() {
          $data['foo'] = 'bar';
          $this-&gt;load-&gt;view('index', $data); //$data already includes $data['config']
      }
  ?&gt;
  </code></pre>
  
  <hr>
  
  <h2>Option 1:</h2>
  
  <p>Some kind of MY_Loader Extension - We already have a MY_Controller, so it wouldn't be too far fetched to do a MY_Loader Class and have MY_Controller call that instead of CI_Loader. However, I'm not sure this is possible.</p>
  
  <h2>Option 2:</h2>
  
  <p>I know this is possible if you edit system files, but I would <strong>really</strong> prefer not doing that. As that makes changes hard to track when updating CI.</p>
  
  <h2>Option 3:</h2>
  
  <p>???</p>
  
  <hr>
  
  <p>Thoughts?</p>
  
  <p><strong>Edit</strong> For Clarification: This is specifically for loading data into <strong>views</strong>, extending <code>CI_Controller</code> and setting member variables there are ONLY accessible from <strong>models and controllers</strong> NOT views.</p>