2017 © Pedro Peláez
 

library forma

A nice way to play with forms in Laravel 4/5 and indeed any PHP project.

image

neondigital/forma

A nice way to play with forms in Laravel 4/5 and indeed any PHP project.

  • Thursday, November 27, 2014
  • by neondigital
  • Repository
  • 2 Watchers
  • 0 Stars
  • 478 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 3 % Grown

The README.md

Forma

IN DEVELOPMENT - But feel free to have a play!, (*1)

A nice way to play with forms in both Laravel 4 and PHP. Does not require Laravel to be used., (*2)

Requires PHP 5.4+, (*3)

For non-Laravel usage use the following format for calls., (*4)

use Forma\Forma;

$forma = new Forma();
echo $forma->email('email')->id('inputEmail')->required();

Clever Features

  1. Auto-repopulation from Input::get() or Input::old() if value not provided
  2. Auto-labels either prepended or wrapped
  3. Checkboxes submit even if not checked (hidden input hack)
  4. Language file support for label and option text
  5. Nest tags within tags
  6. Automatic ID creation for labels and fields
  7. Chaining of methods to quickly do what you need and force it to behave a certain way
  8. Add select options manually and from arrays, great for making a 'Please select' option

Examples


Forma::populate($user); Forma::open('user','GET')->class('glenn')->class('bob')->attr('id','sweet'); Forma::open_secure('article')->files(); Forma::text('first_name','glenn<$@£$T£!^;')->class('form-control')->attr('id','first_name'); Forma::text('last_name')->id('inputLast')->forceEmpty(); Forma::email('email')->id('inputEmail')->required(); Forma::password('password')->id('inputPassword')->allowValue(); Forma::input('color')->type('color')->id('inputColor'); Forma::checkbox('confirm',1)->checked(); Forma::open()->child(Forma::checkbox('confirm',1)->omitHidden()); Forma::label()->child(Forma::checkbox('confirm')); Forma::checkbox('confirm')->withLabel('Please Confirm'); Forma::checkbox('confirm')->id('sweeeetID')->withLabel('Please Confirm'); Forma::input('color')->type('color')->id('inputColor')->withLabel('Pick a color'); Forma::checkbox('confirm')->id('inputConfirm')->wrap('Option One',array('class'=>'checkbox')); Forma::hidden('secret','thing'); Forma::token(); // Laravel only Forma::textarea('secret','thi>ng<dd')->rows(10); Forma::radio('choice')->id('inputChoice')->wrap('Option One',array('class'=>'radio')); Forma::file('image')->id('inputFile')->wrap('Select Image'); Forma::text('last_name')->id('inputLast')->placeholder('Enter last name'); Forma::text('last_name')->id('inputLast')->placeholder('auth.login_failed'); Forma::label('auth.login_failed'); Forma::label('<i class="fa fa-pound"></i> Price')->rawText(); Forma::select('country')->option('- Please Select -')->option('UK',1,true)->withLabel('Select Country'); Forma::select('country')->options(array('1' => 'United Kingdom', '2' => 'France', '3' => 'USA' )); Forma::select('town', array('1' => 'Chelmsford', '2' => 'Brentwood', '3' => 'Colchester' ), 2); Forma::checkbox('cake',1); Forma::button('Click me!!', 'submit')->class('btn btn-primary'); Forma::submit('submit_btn','Save Changes'); Forma::close();

The Versions

27/11 2014

dev-master

9999999-dev

A nice way to play with forms in Laravel 4/5 and indeed any PHP project.

  Sources   Download

MIT

The Requires

 

by Neon Digital

laravel html forms builder

15/09 2014

0.0.9

0.0.9.0

A nice way to play with forms in Laravel 4/5 and indeed any PHP project.

  Sources   Download

MIT

The Requires

 

by Neon Digital

laravel html forms builder

14/06 2014

0.0.8

0.0.8.0

A nice way to play with forms in Laravel 4 and indeed any PHP project.

  Sources   Download

MIT

The Requires

 

by Neon Digital

laravel html forms builder

11/06 2014

0.0.7

0.0.7.0

A nice way to play with forms in Laravel 4 and indeed any PHP project.

  Sources   Download

MIT

The Requires

 

by Neon Digital

laravel html forms builder

01/06 2014

0.0.6

0.0.6.0

A nice way to play with forms in Laravel 4 and indeed any PHP project.

  Sources   Download

MIT

The Requires

 

by Neon Digital

laravel html forms builder

01/06 2014

0.0.5

0.0.5.0

A nice way to play with forms in Laravel 4 and indeed any PHP project.

  Sources   Download

MIT

The Requires

 

by Neon Digital

laravel html forms builder

17/03 2014

0.0.4

0.0.4.0

A nice way to play with forms in Laravel 4.

  Sources   Download

MIT

The Requires

 

by Neon Digital

laravel html forms builder

17/03 2014

0.0.3

0.0.3.0

A nice way to play with forms in Laravel 4.

  Sources   Download

MIT

The Requires

 

by Neon Digital

laravel html forms builder

15/03 2014

0.0.2

0.0.2.0

A nice way to play with forms in Laravel 4.

  Sources   Download

MIT

The Requires

 

by Neon Digital

laravel html forms builder

15/03 2014

0.0.1

0.0.1.0

A nice way to play with forms in Laravel 4.

  Sources   Download

MIT

The Requires

 

by Neon Digital

laravel html forms builder