Is there an elegant way to build the list of selected items to feed the $html->selectTag() in a HABTM relation ??
I ended with for instance:
$materials_selected_designations = array();
for($i=0; $i < sizeof($this->params['data']['Material']); $i++){
$materials_selected_designations[$this->params['data']['Material'][$i]['id']] = $this->params['data']['Material'][$i]['designation'];
}
$this->set('materials_selected_designations', $materials_selected_designations);
its not very elegant compared to:
$this->set('materials_designations',$this->Application->Material->generateList());
The manual doesn't say anything on this, and in the wiki there is only something confuse in understanding_associations.
Any thoughts ??
olivvv
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
- "selected" items in HABTM multiple selec... Olivier Percebois-Garve
- Re: "selected" items in HABTM multi... Jon Bennett
- Re: "selected" items in HABTM m... Olivier Percebois-Garve
