title: CakePHP: Use function from Plugin Controller in Main Controller
body: <p>This should be simple but I've spent over an hour trying to figure it out so thanks for your help.</p>
  
  <p>I've got a CakePHP plugin, <code>Usermgmt</code>, with a controller located here:</p>
  
  <pre><code>./app/Plugin/Usermgmt/Controller/UsersController.php
  </code></pre>
  
  <p>I'm trying to call a function, <code>userIdFromUsernameAndPassword()</code>, in that controller from one of my main controllers using something like:</p>
  
  <pre><code>$userID = $this-&gt;UsersController-&gt;userIdFromUsernameAndPassword( 'user@host.com','pass' );
  </code></pre>
  
  <p>What do I need to import/include/initialize to be able to get this working?</p>
  
  <p>I've tried various import statements such as <code>App::uses('UsersController', 'Usermgmt.Controller');</code> at the top of my file, but haven't gotten anywhere.</p>
  
  <p>Thanks!</p>