title: CakePHP - Get a variable from Post
body: <p>I have a form that looks like so:</p>
  
  <pre><code>&lt;?php
  echo $this-&gt;form-&gt;create('User');
  echo $this-&gt;form-&gt;input('username');
  echo $this-&gt;form-&gt;input('email');
  echo $this-&gt;form-&gt;input('password');
  echo $this-&gt;form-&gt;end('Save');
  ?&gt;
  </code></pre>
  
  <p>And a controller where the file is submitted:</p>
  
  <pre><code>if ($this-&gt;request-&gt;is('post')) {
          $this-&gt;User-&gt;create();
          if ($this-&gt;User-&gt;save($this-&gt;request-&gt;data)) { 
  
          }
  </code></pre>
  
  <p>I am trying to get the input from the form as a variable. Something like..</p>
  
  <pre><code>if ($this-&gt;request-&gt;is('post')) {
          $this-&gt;User-&gt;create();
          if ($this-&gt;User-&gt;save($this-&gt;request-&gt;data)) { 
  
            $username = $this-&gt;form-&gt;input('username');
  
          }
  </code></pre>
  
  <p>Is this possible? to get an input from the form and store it as a variable to use it for something else? </p>
  
  <p>Thank you all in advance!</p>
  
  <p>Using: Cakephp 2.x</p>