title: CakePHP model validation with array
body: <p>I want to use CakePHP's core validation for lists in my model:</p>
  
  <pre><code>var $validate = array(
    'selectBox' =&gt; array(
      'allowedChoice' =&gt; array(
          'rule' =&gt; array('inList', $listToCheck),
          'message' =&gt; 'Enter something in listToCheck.'
      )
    )
  );
  </code></pre>
  
  <p>However, the <code>$listToCheck</code> array is the same array that's used in the view, to populate a selectbox. Where do I put this function?</p>
  
  <pre><code>public function getList() {
      return array('hi'=&gt;'Hello','bi'=&gt;'Goodbye','si'=&gt;'Salutations');
  }
  </code></pre>
  
  <p>Already in my controller, in one of the actions I'm setting it for the view, like:</p>
  
  <pre><code>public function actionForForm() {
      $options = $this-&gt;getList();
      $this-&gt;set('options', $options);
  }
  </code></pre>
  
  <p>So, I don't want to have to copy the <code>getList()</code> function...where can I put it so the Model can call it to populate its <code>$listToCheck</code> array?</p>
  
  <p>Thanks for your help.</p>