0
をレンダリング:sfWidgetFormDoctrineChoiceGrouped私categorieテーブル用
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に追加しました:私は
Categoire with no parent 1
- child categroie
- child categorie..
Categoire with no parent 2
- child categroie
- child categorie..
を持つようにしたいレンダリングで
'categorie' => new sfWidgetFormDoctrineChoiceGrouped(
array(
'group_by' => 'parent',
'order_by' => array('parent_id',''),
'model' => 'Categorie',
'multiple' => true,
'method' => 'getNom',
)),
を
しかし私の場合はレンダリングがあります:
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