Skip to content

NitroXy/php-forms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

193 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Form builder for PHP

Build Status Coverage Status

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.

About

PHP HTML5 Form builder

Resources

License

Stars

Watchers

Forks

Packages

No packages published