예제 #1
0
 /**
  * @return Form
  */
 public function create($model)
 {
     $this->model = $model;
     $form = new BaseForm();
     $form->addHidden('id');
     $form->addText('firstname', 'Jméno')->setRequired("Vyplňte jméno");
     $form->addText('lastname', 'Příjmení')->setRequired("Vyplňte příjmení");
     $form->addRadioList('gender', 'Pohlaví', array("M" => "Muž", "F" => "Žena"))->setRequired("Vyplňte pohlaví");
     $form->addText('email', 'Kontaktní email')->setRequired("Vyplňte kontaktní email")->setType('email')->setAttribute('placeholder', '*****@*****.**');
     $form->addSubmit('send', 'Uložit');
     $form->onValidate[] = array($this, 'validityCheck');
     return $form;
 }
예제 #2
0
 /**
  * @return Form
  */
 public function create($model)
 {
     $this->model = $model;
     $form = new BaseForm();
     $form->addHidden('id');
     $form->addText('firstname', 'Jméno')->setRequired("Vyplňte jméno");
     $form->addText('lastname', 'Příjmení')->setRequired("Vyplňte příjmení");
     $form->addRadioList('gender', 'Pohlaví', array("M" => "Muž", "F" => "Žena"))->setRequired("Vyplňte pohlaví");
     $form->addText('birthdate', 'Datum narození')->setRequired("Vyplňte datum narození")->setType('date')->setValue((new \Nette\Utils\DateTime())->format("Y-m-d"));
     $form->addText('email', 'Kontaktní email')->setRequired("Vyplňte kontaktní email")->setType('email')->setAttribute('placeholder', '*****@*****.**');
     $form->addPassword('password', 'Heslo')->setRequired("Vyplňte heslo");
     $form->addPassword('password2', 'Heslo pro kontrolu')->setRequired("Vyplňte heslo");
     $form->addSubmit('send', 'Uložit');
     $form->onValidate[] = array($this, 'validityCheck');
     return $form;
 }