test

CakePHP Note

Delete(削除)

UPDATE:2008.04.09

class PostsController extends AppController {

    function delete($id = null) {
        if (!$id) {
            $this->Session->setFlash(__('Invalid id for Post', true));
            $this->redirect(array('action'=>'index'));
        }
        if ($this->Post->del($id)) {
            $this->Session->setFlash(__('Post deleted', true));
             $this->redirect(array('action'=>'index'));
        }
    }
}