HosipLan

Untitled

Nov 12th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. class MyForm
  2. {
  3.  
  4.     // public $onSuccess = [];
  5.     public $onSomeAction = [];
  6.  
  7.  
  8.     public function __construct()
  9.     {
  10.         parent::__construct();
  11.  
  12.         // $this->addText();
  13.  
  14.         $this->onSuccess[] = function () {
  15.             $this->onSomeAction($this);
  16.         }
  17.     }
  18.  
  19. }
  20.  
  21. $form = new MyForm;
  22. $form->onSuccess[] = function () {
  23.     $this->redirect();
  24. };
Advertisement
Add Comment
Please, Sign In to add comment