popov / zfc-form
ZF2 form management
Installs: 171
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 0
Type:zf-module
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2025-01-07 03:54:45 UTC
README
Features:
- registered
AbstractFactory
which allow create most ofForm
without factory declaration; - auto resolving for
DoctrineHydrator
andTranslator
; - twitter bootstrap template rendering (only html template without core override);
- save
Form
with Ajax; - Add/Remove buttons for dynamic elements.
Usage
Form can be rendered in template as <?= $this->partial('form::form', ['form' => $form]) ?>
.
Or in action as return (new ViewModel(['form' => $form])->setTemplate('form::form')
.
Custom options
- inline
This option will try to render $fieldset's elements inline one by one with col-sm-*
class.
$fieldset->add([ 'name' => $name, 'type' => Fieldset::class, 'options' => [ 'inline' => true, ], ]);
- column
This option will take number of columns for element.
$element = $fieldset->add([ 'name' => 'value', 'type' => 'text', 'options' => [ 'column' => 6, ], ]);