On Wednesday, October 3, 2012 3:10:30 AM UTC+3, Martin Fall wrote:
> 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!