title: Message: Undefined property: User::$view_data with Codeigniter trying to build a controller
body: <p>I'm trying to build a simple controller for a registration form as seen on a Youtube video, but for some reason, I'm getting an error with a piece of code that works for him.</p>
  
  <pre><code>&lt;?php
  
  class User extends CI_Controller {
  
  function __User() {
  
      parent::CI_Controller();
  
      $this-&gt;view_data['base_url'] = base_url();
  }
  
  function index() {
  
      $this-&gt;register();
  }
  
  function register() {
  
      $this-&gt;load-&gt;view('view_register', $this-&gt;view_data);
  }
  
  }
  </code></pre>
  
  <p>That's what I currently have, with:</p>
  
  <pre><code>$autoload['helper'] = array('url');
  </code></pre>
  
  <p>set in autoload.php.</p>
  
  <p>I've tried to search around for answers to this question, but nothing appears to work and the only solution I've seen was for a slightly different problem. Does anyone have any idea as to what could be wrong?</p>
  
  <p>Also, if it helps any, this is the exact error message:</p>
  
  <pre><code>Severity: Notice
  
  Message: Undefined property: User::$view_data
  
  Filename: controllers/user.php
  
  Line Number: 19
  </code></pre>