title: CakePHP - input select not taking select options from a variable
body: <p>I am developing an application with CakePHP 2.3.2 and I am having some trouble with an input select on a form. I am creating an array, in my Controller, which contains a list of states. In my View I find that when I use this variable in the 'options' field of the input I do not get any select options. If I do a print_r on the variable, in the view, I see exactly what I think I should be seeing for the 'options' field. I have even tried copying this print_r output and putting it in the 'options' field and then the input select works fine.</p>
  
  <p>Here is what I have</p>
  
  <p>In Controller</p>
  
  <pre><code>$options = 'array(1 =&gt; \'NSW\',2 =&gt; \'ACT\',3 =&gt; \'NT\');
  $this-&gt;set('all_states, $options);
  </code></pre>
  
  <p>In View</p>
  
  <pre><code>&lt;?php
  $options = $all_states;
  
  echo $this-&gt;Form-&gt;create('Refine', array('url =&gt; '/ServiceDirectoryResults/view/refine'));
  
  echo $this-&gt;Form-&gt;input('field' ,array(
     'type' =&gt; 'select',
     'label' =&gt; false,
     'options' =&gt; $options
  ));
  
  echo $this-&gt;Form-&gt;end('Refine Search');
  
  ?&gt;
  </code></pre>
  
  <p>When I run this I see a select with no select options</p>
  
  <p>If I add print_r($options) after the echo $this->Form->end('Refine Search'); I see</p>
  
  <pre><code>array(1 =&gt; 'NSW',2 =&gt; 'ACT,3 =&gt; 'NT')
  </code></pre>
  
  <p>Which is what I would expect as it is the content of the $options variable which was the $all_states variable passed from the controller. If I take this output from the print_r and replace the $option with it in the input select the select drop down works fine and I see the three options. For some reason I can't work out the select is working fine if I hard code the select options but it will not work if I pass a variable containing the array to the input select.</p>
  
  <p>I would really appreciate if if someone could give me a clue what I am doing wrong here.</p>
  
  <p>Kind Regards</p>
  
  <p>Richard </p>