sfWidgetFormDoctrineChoice avec groupes
Bonjour
j'ai une table métier qui peut contenir des sous métier
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Metier:
actAs:
Timestampable: ~
I18n:
fields: [libelle]
columns:
id:
type: integer
autoincrement: true
primary: true
libelle: { type: string(255), notnull: true }
parent_id: { type: integer }
relations:
Metier:
local: parent_id
foreign: id
foreignAlias: MetiersEnfants
onDelete: IGNORE |
Je souhaiterais un formulaire ou le user peut choisir les métiers qui lui correspondent.
Métiers triés par groupe de métier parent. (jusque 3 niveau).
J'ai remarqué que sfWidgetFormChoice permet de faire des groupes.
Exemple :
Code:
1 2 3 4 5 6
| $choices = array(
'Europe' => array('France' => 'France', 'Spain' => 'Spain', 'Italy' => 'Italy'),
'America' => array('USA' => 'USA', 'Canada' => 'Canada', 'Brazil' => 'Brazil'),
);
$w = new sfWidgetFormChoice(array('choices' => $choices)); |
comment combiner cette option de sfWidgetFormChoice avec Doctrine et son sfWidgetFormDoctrineChoice