nitroxy / php-forms
Form builder
Installs: 109
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
pkg:composer/nitroxy/php-forms
Requires
- php: >=5.4.0
Requires (Dev)
- easybook/geshi: ~1.0
- phpunit/phpunit: 4.6.*
- satooshi/php-coveralls: ^1.0
- symfony/config: ^2.1
- symfony/console: ^2.1
- symfony/filesystem: ^2.1
- symfony/stopwatch: ^2.0
- symfony/yaml: ^2.0
README
Installation
composer require nitroxy/php-forms
Features
- Create HTML5 forms easily.
- Layout engine (supports tables, divs and bootstrap out-of-the-box).
- Bind forms to PHP objects for reading/data and presenting validation errors.
- CSRF protection.
- Supports REST-verbs such as
PATCH
,PUT
,DELETE
or even custom if desired.
Example
Form::from_object($user, function($f){ $f->text_field('name', 'Name'); $f->text_field('age', 'Age', ['type' => 'number', 'min' => 1]); $f->select(FormSelect::from_array($f, 'role', array('', 'Manager', 'Frobnicator', 'Developer'), 'Role')); $f->textarea('description', 'Description'); }, ['action' => $user->url, 'method' => 'patch']);
See documentation for examples and usage.