0
votes

I have article admin module and a tag module Tags are simply a single tag per row item

What I'd like to do is to embed the list of all the tags (as checkboxes) into my article module

Could I do this with embedded forms?

EDIT:

This is my schema:

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 }

So when I need the tags to be displayed and will update the above tables

1
Are you using Doctrine or Propel? I presume you mean 'model' rather than 'module' also? - richsage
I am using Propel. Well i have an articles admin module (article model) and tag admin module(tag model) and an item model. You can see the relationships in my schema above. I just need to display the tags in terms of choices as checkboxes. Is this possible? - terrid25

1 Answers

0
votes

If you have defined the relationship between the article and tags correctly in your model, then the generated Forms should contain tag select widgets.

Search "sfWidgetFormChoice" in the Forms documentation for more information: http://www.symfony-project.org/jobeet/1_4/Doctrine/en/10

Note: The examples are created using the Doctrine ORM but everything should work the same way with Propel as well.