hey i'm working on comment box so need help
var $belongsTo = array(
'User' => array(
'className' => 'User',
'foreignKey' => 'user_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'Recipe' => array(
'className' => 'Recipe',
'foreignKey' => 'recipe_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
what i wannna do is have user login before using the comment then
and comment on the recipe they are viewing
so what you guys think
function add() {
if (!empty($this->data)) {
$this->Comment->create();
if ($this->Comment->save($this->data)) {
$this->Session->setFlash(__('The Comment has
been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Comment could
not be saved.
Please, try again.', true));
}
}
$this->set(compact('users', 'recipes'));
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---