Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Implement tags in symfony 1.4 (merging forms, validating, saving)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Martin Fall  
View profile  
 More options Oct 2 2012, 8:10 pm
From: Martin Fall <martinf...@gmail.com>
Date: Tue, 2 Oct 2012 17:10:30 -0700 (PDT)
Local: Tues, Oct 2 2012 8:10 pm
Subject: Implement tags in symfony 1.4 (merging forms, validating, saving)

I'm building a website in symfony 1.4 that has some of the functionality
that www.askeet.com shows. In the askeet tutorials, the steps to tag a
question once the question is posted are very clear. However, there are no
instructions on how to embed the questionTagForm in the questionForm, use
autocomplete or update the save() method to update questionTags when
question is saved.

Here's my schema for question:

question:
  columns:
    id:
      primary: true
      type: integer
      notnull: true
      autoincrement: true
    question_title:
      type: string(255)
      notnull: true
    question_body:
      type: string(4000)
      notnull: true
    user_id:
      type: integer
      notnull: true
    category_id:
      type: integer
  relations:
    sfGuardUser:
      class: sfGuardUser
      local: user_id
      foreign: id
      onDelete: CASCADE
    category:
      onDelete: SET NULL
      onUpdate: CASCADE
      local: category_id
      foreign: id

The schema for questionTag is as follows:

questionTag:
  actAs:
    Timestampable:
  columns:
    question_id:
      type: integer
      notnull: true
    user_id:
      type: integer
      notnull: true
    tag:
      type: string(255)
    normalized_tag:
      type: string
  relations:
    question:
      onDelete: CASCADE
      local: question_id
      foreign: id
    sfGuardUser:
      class: sfGuardUser
      local: user_id
      foreign: id
      onDelete: CASCADE

Here's what I think I need to do:

   1. Merge, embed or otherwise include the form questionTag or a form
   field that will be passed to questionTag, get normalized and saved.
   2. I aslo need to pass the question_id and user_id so that they are
   saved along with the tag and its normalized counterpart.
   3. I also would like to add autocomplete in the sense of what the action
   should return is a list of tags entered by the user that match the entry in
   the tag field, without duplicates, ordered by alphabetical order. I have
   such an action from the tags tutorial in askeet day 13 and 14. (I already
   have public function executeAutocomplete() in the
   modules/tag/actions/action.class.php file

The Askeet Tutorial Day 13: Tags<http://www.symfony-project.org/askeet/1_0/en/13>

The Askeet Tutorial Day 14: Tags, part II<http://www.symfony-project.org/askeet/1_0/en/14>

I have installed sfProtoculousPlugin so that I can use the Javascript
helper such as <?php use_helper('Javascript') ?> and use
input_auto_complete_tag

I need help figuring out how to do this. I am new to symfony and have been
hacking my way through this project pretty well so far. I need a push in
the right direction. Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gabriel Petchesi  
View profile  
 More options Oct 3 2012, 10:17 am
From: Gabriel Petchesi <pghora...@gmail.com>
Date: Wed, 3 Oct 2012 07:17:36 -0700 (PDT)
Local: Wed, Oct 3 2012 10:17 am
Subject: Re: Implement tags in symfony 1.4 (merging forms, validating, saving)

There is some information on how to do something similar in the do more
with symfony book:
http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-F...

Regarding autocomplete behaviour my suggestion is to solve it entirely in
javascript, do not use autocomplete widgets (not sure if it would help you
in this case).

    gabriel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »