0
我categorie表:sfWidgetFormDoctrineChoiceGrouped渲染
Categorie:
actAs:
Timestampable: ~
Sluggable:
fields: [nom]
NestedSet: ~
columns:
parent_id: { type: integer(8), notnull: false}
nom: { type: string(255), notnull: true, unique: true }
relations:
CategorieParent: { onDelete: SET NULL, local: parent_id, class: Categorie, foreign: id, foreignAlias: CategorieEnfants}
我已經添加到我的形式,這種配置的sfWidgetFormDoctrineChoiceGrouped:
'categorie' => new sfWidgetFormDoctrineChoiceGrouped(
array(
'group_by' => 'parent',
'order_by' => array('parent_id',''),
'model' => 'Categorie',
'multiple' => true,
'method' => 'getNom',
)),
在渲染我想有
Categoire with no parent 1
- child categroie
- child categorie..
Categoire with no parent 2
- child categroie
- child categorie..
但在我的情況下,我有一個渲染:
Categoire with no parent 1
Categoire with no parent 2
Categoire with no parent 3
Categoire with no parent 1
- child categroie
- child categorie..
謝謝
我發現了一個解決方案,但我現在,theres不是最好的,我修改了這樣的widgetClass。 – Amine
然後你可以[接受我的回答](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work)? – j0k