public function create() { $form = new \Natsu\Forms\BaseForm(); $form->addHidden("id"); $form->addHidden("contentId")->setValue($this->contentId); $form->addSelect("roleId", "Role")->setItems($this->roles); $form->addCheckbox("writable", "Zápis"); $form->addCheckbox("deletable", "Smazani"); $form->addCheckbox("forbidden", "Zákaz"); $form->addSubmit("save", "Uložit"); $form->onSuccess[] = array($this, 'formSucceeded'); if ($this->contentPermission) { $form->setDefaults($this->contentPermission); } return $form; }
/** * @return Form */ public function create() { $form = new \Natsu\Forms\BaseForm(); $form->addText('username', 'Uživatelské jméno:')->setRequired('Zadej uživatelské jméno.'); $form->addPassword('password', 'Heslo:')->setRequired('Zadej heslo.'); $form->addCheckbox('remember', 'Zapamatovat přihlášení'); //$form->addDateTimePicker('date', 'Datum'); $form->addSubmit('send', 'Sign in'); $form->onSuccess[] = array($this, 'formSucceeded'); return $form; }