public function handleRead($id = NULL) { if ($id) { $this->article->read($id); $this->payload->remove = '#article-' . $id; $this->flashMessage('Article removed.'); } else { $this->article->read_all(); $this->payload->remove = '.list .item'; $this->flashMessage('All articles removed.'); } if ($this->isAjax()) { $this->sendPayload(); $this->terminate(); } else { $this->redirect('Homepage:default'); } }