enjoys/forms

forms 5.x dev


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

port=$(shuf -i 2048-65000 -n 1);
php -S localhost:"${port}" -t ./example .route