title: Calling AppModel function in AppController for cakephp
body: <p>I have a function that I want all of my controllers to be able to use, so I have defined it in AppController. Now part of what this function will do has no business being in a controller and so it should be in a model, but since this is a universal operation, it only seems correct that it be in AppModel. My function looks as followed:</p>
  
  <pre><code>class AppController extends Controller {
  
      public function i_need_this_everywhere ($term) {
          // do some stuff
  
          // this is the line that is an issue
          // it seems like this should be simple and work, but no variation of this is working
          $value = $this-&gt;App-&gt;get_some_cool_data($term);
  
          return $value;
      }
  
  }
  </code></pre>
  
  <p>I simply want to be able to call an AppModel function from AppController. I have tried the following:</p>
  
  <pre><code>// I have tried several variations of this.
  $this-&gt;loadModel('AppModel');
  $this-&gt;AppModel-&gt;get_some_cool_data($term);
  </code></pre>
  
  <p>But this then complains about the lack of database table called AppModel, at which point, in AppModel I tried setting:</p>
  
  <pre><code>public $useTable = FALSE;
  </code></pre>
  
  <p>But that blows the whole app up so... Now I am out of ideas. Any help would be greatly appreciated. </p>