Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Nette\Application\UI;
- class HomepagePresenter extends UI\Presenter
- {
- // ...
- protected function createComponentRegistrationForm()
- {
- $form = new UI\Form;
- $form->addText('name', 'Jméno:');
- $form->addPassword('password', 'Heslo:');
- $form->addSubmit('login', 'Registrovat');
- $form->onSuccess[] = [$this, 'registrationFormSucceeded'];
- return $form;
- }
- // volá se po úspěšném odeslání formuláře
- public function registrationFormSucceeded(UI\Form $form, $values)
- {
- // ...
- $this->flashMessage('Byl jste úspěšně registrován.');
- $this->redirect('Homepage:');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement