title: CakePHP: Managing table names in a controller with a single variable
body: <p>In controller A, I load a model not associated with this controller. I'm interested in managing the model name of controller B with a single variable, so I don't have to manually change many lines if the table/model B's name changes.</p>
  
  <p>For example below is the controller A's code:</p>
  
  <pre><code>public $modelBName = 'ModelB';
  
  public function controller_a_function() {
      $this-&gt;loadModel($this-&gt;modelBName);    // I use the variable here for model B
  
      $this-&gt;ModelB-&gt;model_b_function();    // COMMENT #1
  }
  </code></pre>
  
  <p>Question:
  For the line commented "COMMENT #1," how do I use the variable name instead of explicitly written out word 'ModelB'? This line appears multiple times throughout the code, and I would like to use the variable <code>$modelBName</code> if possible. <code>ModelB</code> will likely not change, but if it does for some reason, it would be nice to just change one variable instead of editting multiple lines.</p>