Thank you.
$cities = $this->City->find('all', array('fields' => array('City.id',
'City.name', 'Country.iso2', 'Country.name'),
'order'=>'City.country_id ASC'));
$citiesCombine = Set::combine($cities, '{n}.City.id', array('%s - %s',
'{n}.Country.iso2', '{n}.City.name'), '{n}.Country.name');
$th
On Feb 7, 2:06 pm, Josoroma <[EMAIL PROTECTED]> wrote:
> Im trying to generate a select list, but before the value Citiy.name i
> need to add Country.name like:
>
> Costa Rica - Heredia
> EEUU - New York
>
> $cities = $this->City->find('all', array('fields' => array('City.id',
> 'City.name', 'Co
Sorry, bit of a typo there - where I've got
'{n}.Country.name', '{n}.Country.name' [several times]
It should of course be
'{n}.Country.name', '{n}.City.name'
On Feb 7, 1:34 pm, grigri <[EMAIL PROTECTED]> wrote:
> To do exactly what you want:
>
> $citiesCombine = Set::combine($cities, '{n}.City
To do exactly what you want:
$citiesCombine = Set::combine($cities, '{n}.City.id', array('%s - %s',
'{n}.Country.name', '{n}.Country.name'));
But wouldn't you be better off generating option groups based on the
country? That's easy too:
$citiesCombine = Set::combine($cities, '{n}.City.id',
'{n}
Im trying to generate a select list, but before the value Citiy.name i
need to add Country.name like:
Costa Rica - Heredia
EEUU - New York
$cities = $this->City->find('all', array('fields' => array('City.id',
'City.name', 'Country.name'), 'order'=>'City.country_id ASC'));
My question is, how ca