Hi there cakephp experts! I am looking for you help on a dyanmic dropdown list with dyanamic optgroup. Suppose I have two tables:
countries: id, country_na
You can also use the Hash::combine function instead of a nested loop as suggested by @neilcrookes
$counties = Hash::combine($countries,'{n}.County.id','{n}.County.name','{n}.Country.name');