Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Control extends \Nette\Application\UI\Control
- {
- public $onSuccess = array();
- public function something()
- {
- $this->onSuccess(); // můžeš předat jakékoli parametry
- }
- }
- class Presenter extends \Nette\Application\UI\Presenter
- {
- public function createComponentSomething()
- {
- $control = new Control();
- $presenter = $this;
- $control->onSuccess[] = function() use ($presenter) {
- $presenter->redirect('Target:action');
- };
- return $control;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment