Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @method onAttached(\BaseForm $form, \BasePresenter $presenter)
- * @method onError(\Nette\Forms\Form $form)
- *
- * @property \BasePresenter $presenter
- * @property-read \BasePresenter $presenter
- */
- class BaseForm extends \Nette\Application\UI\Form
- {
- /**
- * @var array of function (BaseForm $form, Nette\Application\UI\Presenter $presenter)
- */
- public $onAttached = array();
- public function __construct()
- {
- parent::__construct();
- $this->getElementPrototype()->novalidate = "novalidate";
- }
- protected function attached($parent)
- {
- parent::attached($parent);
- if (!$parent instanceof Nette\Application\UI\Presenter) {
- return;
- }
- $this->setTranslator($this->presenter->context->getByType('Nette\Localization\ITranslator'));
- $this->onAttached($this, $parent);
- }
Advertisement
Add Comment
Please, Sign In to add comment