Okay... what I'm doing is creating a survey site.  I have the add
questions, and the surveys on different models though, so that people
can add as many questions or as few as they like.

What I want to do is get the person to go to URL

testsite.com/questions/add/1 or testsite.com/questions/add/surveyid:1

and in a hidden form in the view have it add the question to their
particular survey (in this case survey 1).

Or is there a better way of doing this?  I know this leaves me open to
amateur URL hacking... ideally I would like to take the data from them
creating the survey (id and what not) and just use that directly.

Such as could I use in the controller something like:

           if (!empty($this->data)) {

                if (!empty($survey_id)) {
                        $this->data['Survey']['survey_id'] = $survey_id;
                }

                        $this->Question->create();

                        if ($this->Question->save($this->data)) {

                                $this->flash(__('Question saved.', true),
array('action'=>'index'));

                        } else {

                        }

                }

and if so do I just call the $survey_id in the view?  I am so
confused, and a bit over my head at the moment... any help is
appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to