0

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

2
  • Are you using Doctrine or Propel? I presume you mean 'model' rather than 'module' also? Commented Jan 26, 2011 at 14:38
  • 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? Commented Jan 27, 2011 at 9:18

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

2 Comments

That's not really helpful. It just shows how to embed and merge a form

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.