HosipLan

Untitled

Feb 4th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1.  
  2. /**
  3.  * @method onAttached(\BaseForm $form, \BasePresenter $presenter)
  4.  * @method onError(\Nette\Forms\Form $form)
  5.  *
  6.  * @property \BasePresenter $presenter
  7.  * @property-read \BasePresenter $presenter
  8.  */
  9. class BaseForm extends \Nette\Application\UI\Form
  10. {
  11.  
  12.     /**
  13.      * @var array of function (BaseForm $form, Nette\Application\UI\Presenter $presenter)
  14.      */
  15.     public $onAttached = array();
  16.  
  17.  
  18.  
  19.     protected function attached($parent)
  20.     {
  21.         parent::attached($parent);
  22.  
  23.         if (!$parent instanceof Nette\Application\UI\Presenter) {
  24.             return;
  25.         }
  26.  
  27.         $this->setTranslator($this->presenter->context->getByType('Nette\Localization\ITranslator'));
  28.  
  29.         $this->onAttached($this, $parent);
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment