title: Cannot access a variable in a codeigniter model
body: <p>I am trying to access an array set in a model from a codeigniter controller, and things are acting odd.</p>
  
  <p>Currently all I have in the model is this:</p>
  
  <pre><code>class Pages_model extends CI_Model {
      function __construct()
      {
          parent::__construct();
      }
  
      var $pages = array(
          'draw', 'stackoverflow', 'words'
      );
  }
  </code></pre>
  
  <p>I can see the array is being set because when I execute</p>
  
  <pre><code>$this-&gt;load-&gt;model('Pages_model');
  die(var_dump(get_object_vars($this-&gt;Pages_model)));
  </code></pre>
  
  <p>I get the output</p>
  
  <pre><code>array
    'pages' =&gt; 
      array
        0 =&gt; string 'draw' (length=4)
        1 =&gt; string 'stackoverflow' (length=13)
        2 =&gt; string 'words' (length=5)
  </code></pre>
  
  <p>But when I try to access the variable itself:</p>
  
  <pre><code> $this-&gt;load-&gt;model('Pages_model');
   die(var_dump($this-&gt;Pages_model-&gt;$pages));
  </code></pre>
  
  <p>I get an error:</p>
  
  <blockquote>
    <p>Message: Undefined variable: pages</p>
  </blockquote>
  
  <p>This does not make any sense to me. What is going on????</p>