0
для моей категории таблицы: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..
Спасибо
ihave нашел решение, но я сейчас, theres не самый лучший, я изменил widgetClass вот так. – Amine
вы могли бы [принять мой ответ] (http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work)? – j0k