there is an argument for generateList that group your result by state:
$places_list    = $this->Hobby->Place->generateList(null, 'name ASC',
null, null, null, '{n}.Place.state');

and with a little post-processing, you'll have counts:
foreach ($places_list as $state => $places) {
  foreach ($places as $place_id => $place) {
    $count = $this->Hobby->Person->findCount(array('place_id' =>
$place_id));
    $places_list[$state][$place_id] = $places_list[$state]
[$place_id] . ' (' . $count . ')';
  }
}
$this->set('places', $places_list);

and in you view:
<?php echo $form->input('Place.id', array('options' => $places,
'empty' => 'Choose a place')) ?>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to