title: CakePHP - populating select form
body: <p>I'm trying to populate a drop down select form with values from a database.  </p>
  
  <p>Here is what I have currently.</p>
  
  <pre><code>$modes = Set::combine($this-&gt;Setting-&gt;find('all', array('conditions' =&gt; array('setting_name LIKE' =&gt; 'mode_%'))), '{n}.Setting.id','{n}.Setting.setting_name');
  $this-&gt;set('modes', $modes);
  </code></pre>
  
  <p>Then in the view, this is what I have</p>
  
  <pre><code>echo $form-&gt;select('current_mode',$modes);
  </code></pre>
  
  <p>That output</p>
  
  <pre><code>&lt;select name="data[Setting][current_mode]" id="SettingCategoryId"&gt;
  &lt;option value=""&gt;&lt;/option&gt;
  &lt;option value="2"&gt;mode_2&lt;/option&gt;
  &lt;option value="1"&gt;mode_1&lt;/option&gt;
  &lt;option value="3"&gt;mode_3&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>The output that I have right now almost work but how can I make the output to be like this?</p>
  
  <pre><code>&lt;select name="data[Setting][current_mode]" id="SettingCategoryId"&gt;
  &lt;option value="mode_2"&gt;Title 2&lt;/option&gt;
  &lt;option value="mode_1"&gt;Title 1&lt;/option&gt;
  &lt;option value="mode_3"&gt;Title 3&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Note:<br>
  1. no default option with empty value<br>
  2. Option's value isn't the id and titles comes from a "title" field in the table   </p>
  
  <p>Thanks,<br>
  Tee</p>