Guest User

Untitled

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