enjoys/forms

forms 5.x dev

5.5.0-rc3 2022-05-14 23:14 UTC

README

Mutation testing badge Code Coverage Scrutinizer Code Quality php 8.0

Init form

use Enjoys\Forms\Form;
$form = new Form();
//or
$form = new Form('get', 'action.php');

Added Elements

use Enjoys\Forms\Form;
use Enjoys\Forms\Elements;

$form = new Form();
$form->text('name', 'label');

//or
$textElement = new Elements\Text('name', 'label');
$form->addElement($textElement);

List Elements

  • button
  • captcha (need CaptchaInterface Implement)
  • checkbox
  • color
  • datalist
  • date
  • datetime
  • datetimelocal
  • email
  • file
  • group
  • header
  • hidden
  • html
  • image
  • month
  • number
  • password
  • radio
  • range
  • reset
  • search
  • select
  • submit
  • tel
  • text
  • textarea
  • time
  • url
  • week

Run built-in server for view example

php -S localhost:8000 -t ./example .route