0

記事管理モジュールとタグモジュールがありますタグは行アイテムごとに1つのタグです

私がやりたいのは、すべてのタグのリストを(チェックボックスとして)記事モジュールに埋め込むことです

埋め込みフォームでこれを行うことはできますか?

編集:

これは私のスキーマです:

article:
  id:                                      ~
  title:                                   { type: VARCHAR, size: '255', required: true }
  tags:                                    { type: VARCHAR, size: '500' }
  created_at:                              { type: TIMESTAMP, required: true }
  updated_at:                              { type: TIMESTAMP, required: true }

tag:
  id:                                      ~
  tag:                                     { type: VARCHAR, size: '500', required: true } 
  ord_id:                                  { type: INTEGER,  required: true }
  created_at:                              ~
  updated_at:                              ~

item_tag:
  id:                                      ~
  item_id:                                 { type: INTEGER, required: true, foreignTable: item, foreignReference: id, onDelete: cascade }
  tag_id:                                  { type: INTEGER, required: true, foreignTable: tag, foreignReference: id, onDelete: restrict }
  created_at:                              ~

item:
  id:                                      ~
  article_id:                              { type: INTEGER, foreignTable: article, foreignReference: id, onDelete: cascade }

したがって、タグを表示する必要があり、上記のテーブルを更新する場合

4

1 に答える 1

0

モデルで記事とタグの関係を正しく定義している場合、生成されるフォームにはタグ選択ウィジェットが含まれている必要があります。

詳細については、フォームのドキュメントで「sfWidgetFormChoice」を検索してください: http ://www.symfony-project.org/jobeet/1_4/Doctrine/en/10

注:例はDoctrine ORMを使用して作成されていますが、Propelでもすべて同じように機能するはずです。

于 2011-01-26T15:44:03.513 に答える