title: CakePhp 2.6 How to extend CakeRequest
body: <p>I'm trying to extend CakeRequest object to add a couple helper functions so I can make calls similar to how Laravel does it:</p>
  
  <p>Laravel </p>
  
  <pre><code>$request-&gt;only('username', 'password');
  </code></pre>
  
  <p>CakePHP 2.6</p>
  
  <pre><code>$this-&gt;request-&gt;only('username', 'password');
  </code></pre>
  
  <p>The only two examples I've found are these: <a href="https://stackoverflow.com/questions/21394852/whats-the-correct-method-for-using-traits-and-namespaces-for-cakephp-2">1</a> <a href="http://www.programering.com/a/MjNwkjMwATA.html" rel="nofollow noreferrer">2</a></p>
  
  <p>But I don't understand how this actually is working, and <code>app/Config/bootstrap.php</code> doesn't have <code>require APP . 'Lib' . DS . 'Network' . DS . 'CakeRequest.php';</code> for me to override with <code>require APP . 'Lib' . DS . 'Network' . DS . 'AppCakeRequest.php';</code> as they suggest.</p>
  
  <p>How do you extend the functionality of CakeRequest in CakePHP 2.6?</p>