title: $this->var or $var
body: <p>I just started using OOP / CodeIgniter. I want to get assign the form input to variables. I wonder which one I should use <code>$this -&gt; var</code> or  <code>$var</code> and how they differ from each other? Thanks.</p>
  
  <p>For example </p>
  
  <pre><code>$agree = $this -&gt; input -&gt; post( 'agree' );
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>$this -&gt; agree = $this -&gt; input -&gt; post( 'agree' );
  </code></pre>
  
  <p>Both will work fine like:</p>
  
  <pre><code>if ($agree) { }
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>if ($this -&gt; agree){ }
  </code></pre>
  
  <p>Thanks</p>