$getCities = $this->requestAction('objekts/getCities');
This returns me a list with ids and names of cities in alphabetical order. When I debug $getCities I can see the alphabetical order.
This is the way how I select the data:
$results = $this->find('list', array(
'conditions' => array($and, $andZone),
'fields' => 'REG_ID, REG_NAME',
'group' => 'REG_ID',
'order' => array('REG_NAME ASC')
));
Again, the debug data is in alphabetical order.
But!
echo $this->Form->input('city', array('label' => __('Nach Ort suchen'), 'empty' => __('Bitte wählen'), 'options' => $getCities, 'id' => 'city', 'class' => 'styled-select'));
This is changing the order to it's id's and does not keep my alphabetical order on the city names.
Is there anything I can add to the $this->Form->input to set my order to names instead of ids?
Please advice!
Thanks!!
edit:
this is the debug array
'{"4":"Alar\u00f3","67":"Algaida","99":"Alqueria Blanca","5":"Andratx","6":"Art\u00e1","8":"Bendinat","105":"Biniali","9":"Binissalem","70":"Bunyola",.....
this is the html output
<select id="city" class="styled-select" name="data[Objekt][city]">
<option value="">Bitte wählen</option>
<option value="4">Alaró</option>
<option value="5">Andratx</option>
<option value="6">Artá</option>
....
<option value="67">Algaida</option>
...
<option value="99">Alqueria Blanca</option>
....