public function deleteAction() { $record = Block::find($this->getParam('id')); if ($record) { $record->delete(); } $this->alert('Record deleted.'); $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'csrf' => NULL)); }
public function indexAction() { $page_id = $this->getParam('id'); $block = Block::find($page_id); if (!$block instanceof Block) { throw new \DF\Exception('Invalid block ID.'); } $this->view->block = $block; }