I'm working on a project, which requires to do some file upload, this
last task works fine (I included a plugin)
But when it comes to the callback function after a delete for example
of a record, it doesn't work for some unknown reasons!
Example.
After a delete of an image record from the database, I gotta delete
the file as well from the web root directory.
the first part is working which is to delete the file from the DB, but
deleting the file from webroot is not, cause it's related delete code
resides in afterSave callback function ..
function admin_beforeSave() {
exit();//stop the execution, just 2 see if the callback is
called, :(
}
function admin_delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for type',
true));
$this->redirect(array('action'=>'index'));
}
if ($this->Type->delete($id)) {
$this->Session->setFlash(__('Type deleted', true));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Type was not deleted', true));
$this->redirect(array('action' => 'index'));
}
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