/** * (non-PHPdoc) * * @see \Simplify\Controller::indexAction() */ protected function indexAction() { try { $this->Form = new \Simplify\Form('options', __('Opções')); $this->Form->showMenu = false; $this->Form->addAction(new \Simplify\Form\Action\Config('config', __('Gerais'), \Simplify::config()->get('amp:tables:options'), 'option_name', 'option_value')); $this->Form->addElement(new \Simplify\Form\Element\Text('site_name', __('Nome do site')), \Simplify\Form::ACTION_CONFIG); $url = new \Simplify\Form\Element\Text('site_url', __('URL do site')); $this->Form->addElement($url, \Simplify\Form::ACTION_CONFIG); $this->Form->execute(); } catch (\Simplify\ValidationException $e) { \Simplify::session()->warnings(__('Ocorreram erros')); } $this->set('formBody', $this->Form->render()); }
protected function createActions(\Simplify\Form $form) { if ($this->show(\Simplify\Form::ACTION_LIST)) { $form->addAction(new \Simplify\Form\Action\Index(null, __('Listar'))); } if ($this->show(\Simplify\Form::ACTION_VIEW)) { $form->addAction(new \Simplify\Form\Action\View(null, __('Visualizar'))); } if ($this->show(\Simplify\Form::ACTION_EDIT)) { $form->addAction(new \Simplify\Form\Action\Edit(null, __('Editar'))); } if ($this->show(\Simplify\Form::ACTION_CREATE)) { $form->addAction(new \Simplify\Form\Action\Create(null, __('Criar'))); } if ($this->show(\Simplify\Form::ACTION_DELETE)) { $form->addAction(new \Simplify\Form\Action\Delete(null, __('Remover'))); } }
protected function createActions() { $this->Form->addAction(new \Simplify\Form\Action\Config('config', $this->getTitle(), $this->getTable(), $this->nameField, $this->valueField)); }