public function doAdd(array $data) { if ($Box = Box::get()->filter(array("Title" => $data['Title']))->first()) { $this->addErrorMessage('Title', _t('BoxAddForm.TITLEEXISTS', 'BoxAddForm.TITLEEXISTS'), 'bad'); $this->controller->redirectBack(); return false; } $Box = Box::create(); $this->saveInto($Box); $Box->write(); $this->controller->redirect('boxadmin/boxes'); }
public function renderWithBox($title, $class = '') { return Box::create()->setTitle($title)->setClass($class)->setBody($this->render())->render(); }