Hi
I'm trying to use the moveup movedown functions from the cake book. I
have the following and it doesn't return any errors, i've checked the
values in the function, but it's not working. I get the success
message but nothing has changed in the database, the record has not
been modified?
I've checked the logs etc but can't see anything. Any help would be
appreciated.
Ross
Here's my link
echo $html->link(__('Move Down', true), array('controller' =>
'categories', 'action'=>'movedown', $category['Category']['name'],
1));
and the controller function
function admin_movedown($name = null, $delta = null) {
$cat = $this->Category->findByName($name);
if (empty($cat)) {
$this->Session->setFlash('There is no category named ' .
$name);
$this->_flash(__('There is no category named '.$name,
true),'error');
$this->redirect(array('action' => 'index'), null, true);
}
$this->Category->id = $cat['Category']['id'];
if ($delta > 0) {
$this->Category->moveDown($this->Category->id,
abs($delta));
$this->_flash(__('Category moved down successfully.',
true),'success');
} else {
$this->_flash(__('Please provide the number of positions
the field should be moved down.', true),'error');
}
$this->redirect(array('action' => 'index'), null, true);
}
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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