HosipLan

Untitled

Apr 2nd, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. class Control extends \Nette\Application\UI\Control
  3. {
  4.     public $onSuccess = array();
  5.  
  6.     public function something()
  7.     {
  8.         $this->onSuccess($this); // můžeš předat jakékoli parametry
  9.     }
  10. }
  11.  
  12. class Presenter extends \Nette\Application\UI\Presenter
  13. {
  14.     protected function createComponentSomething()
  15.     {
  16.         $control = new Control();
  17.         $control->onSuccess[] = function($control) {
  18.             $control->presenter->redirect('Target:action');
  19.         };
  20.         return $control;
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment