Exemplo n.º 1
0
 /**
  * @return type New/edit uzivatele
  */
 protected function createComponentManageUser()
 {
     $form = $this->userForm->create($this->myUser);
     $form->onSuccess[] = function ($form) {
         $form->getPresenter()->redirect('this');
     };
     return $form;
 }
Exemplo n.º 2
0
 /**
  * User form factory.
  * @return Nette\Application\UI\Form
  */
 protected function createComponentUserForm()
 {
     if ($this->user->loggedIn) {
         // pro update
         $form = $this->userFactory->create($this->user->id);
     } else {
         // pro insert
         $form = $this->userFactory->create();
     }
     $form->onSuccess[] = function ($form) {
         $values = $form->getValues();
         if ($this->user->loggedIn) {
             $this->flashMessage('Váš profil byl úspěšně upraven.');
         } else {
             if ($values->id_gender == 1) {
                 $this->flashMessage('Byl jste úspěšně zaregistrován.');
             } else {
                 $this->flashMessage('Byla jste úspěšně zaregistrována.');
             }
         }
         $this->redirect('Homepage:default');
     };
     return $form;
 }
Exemplo n.º 3
0
 public function createComponentFormUser()
 {
     $form = $this->userFormFactory->create($this->model);
     $form->onSuccess[] = array($this, 'userFormSucceeded');
     return $form;
 }