webchemistry / forms
This package is abandoned and no longer maintained.
No replacement package was suggested.
There is no license information available for the latest version (2.0.0) of this package.
Extension for Nette forms
2.0.0
2016-09-07 19:22 UTC
Requires
- php: >= 5.4.0
- nette/forms: ^2.3
- webchemistry/forms-controls: ~1.1
Requires (Dev)
- codeception/codeception: ^2.1
- latte/latte: 2.3
- nette/application: 2.3
- nette/di: 2.3
- nette/forms: 2.3
- webchemistry/forms-doctrine: ^1.0
Suggests
- webchemistry/forms-doctrine: Converts entity to array and back.
- webchemistry/forms-wizard: Wizard
README
Installation
Neon
extensions: form: WebChemistry\Forms\DI\FormsExtension form: factories: front: WebChemistry\Forms\Factory\DefaultFormFactory
Faster containers
class ExampleForm extends WebChemistry\Forms\Control { public function createMyForm() { $form = $this->createForm(); $form->addText('text', 'Text'); $form->addText('container.text', 'Text'); $form->addText('container.textTwo', 'Text two'); $form->addContainer('container')->addText('container.text', 'Text'); $form->addText('container.container.textTwo', 'Text two'); unset($form['container.text']); isset($form['container.text']); / return $form; } }
Reusable forms with WebChemistry\Forms\Control
Control:
class ExampleForm extends WebChemistry\Forms\Control { public function createMyForm() { $form = $this->createForm(); // Returns form by module from Application or default, if module not set $form->addText('text', 'Text'); return $form; } }
Presenter:
class FooPresenter extends Nette\Application\UI\Presenter { /** @var ExampleForm */ private $exampleForm; public function __construct(ExampleForm $exampleForm) { $this->exampleForm = $exampleForm; } public function createComponentForm() { return $this->exampleForm->createMyForm(); } }
Custom factories
config:
form: factories: front: FrontFactory # for FrontModule admin: AdminFactory # for AdminModule