Hey Guys,
i have an little problem!
I wanna add in my sql-db 'ftopics' the values 'name' & 'forum_id'.
The forum_id is an parameter in the URL like : 'cakeboard/topics/add/
5'. Than I wanna add an topic in forum with id 5...
Of Cource I want add a content and a subject to the topic.. In my view
I have the lines:
echo $form->create('Topic', array('action' => 'add'));
echo $form->input('subject');
echo $form->input('content');
echo $form->end('Add');
so.. ehm the user can input subject & content of the new topic with
the form.. How can I get the inputs from the view AND the forum_id
from the URL parameter ??
here is a snippet of my topic add function:
function add($forum_id = null) {
if($forum_id != null && $this->data != null){
//echo $this->data['Topic']['name'];
$this->data['Topic']['forum_id'] = $forum_id;
$this->Topic->create();
$this->Topic->save($this->data);
} else {
$this->Session->setFlash('Please insert title and
content and the
forum_id in URL!');
}
}
At the moment I can`t add forum_id & the user-inputs to the DB in one
entry, because I only get the forum_id from parameter OR the user-
inputs..
Thanks a lot !
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---