mati-core / form
Form factory for nette framework
v1.0.0
2021-02-24 08:36 UTC
Requires
- php: >=8.0
- baraja-core/package-manager: ~2.0
- nette/application: ^3.0
- nette/bootstrap: ^3.0
- nette/di: ^3.0
- nette/forms: ^3.0
- nette/neon: ^3.0
- nette/security: ^3.0
- nette/utils: ^3.0
Requires (Dev)
- nette/tester: ~2.0
- phpstan/phpstan: ^0.12
- phpstan/phpstan-nette: ^0.12.6
- tracy/tracy: ^2.3
This package is auto-updated.
Last update: 2024-11-24 17:06:33 UTC
README
Install
Comoposer command:
composer require mati-core/form
Trait for Presenter
final class *Presenter extends BasePresenter { use FormFactoryTrait; }
Using
final class *Presenter extends BasePresenter{ use FormFactoryTrait; public function createComponentMyForm(): Form { $form = $this->formFactory->create(); $form->addText('myText', 'My text'); $form->onSuccess[] = function (Form $form, ArrayHash $values): void { $text = $values->myText; }; return $form; } }