2017 © Pedro Peláez
 

library html5inputs

Adds support for all 11 remaining HTML5 elements (Laravel already supports 2 out of the box) using Laravels 4.2 Form interface (e.g. Form::date())

image

smalldogs/html5inputs

Adds support for all 11 remaining HTML5 elements (Laravel already supports 2 out of the box) using Laravels 4.2 Form interface (e.g. Form::date())

  • Thursday, November 20, 2014
  • by brwnll
  • Repository
  • 6 Watchers
  • 11 Stars
  • 3,060 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

Laravel HTML 5 Inputs

Build Status License Version Packagist, (*1)

Composer package which adds support for HTML5 elements by extending Laravel's Form interface (e.g. Form::date()), (*2)

Adds support for: color, date, datetime, datatime-local, month, number, range, search, tel, time, week. Laravel Form interfce supports Email & Url out of the box., (*3)

This package allows you to use HTML5 inputs the same way as normal text fields Form::color('inputName');, (*4)

Upgrade From v1

  1. In your composer.json file, update the require line for this package to 2.*, (*5)

    ```json "require": { "smalldogs/html5inputs": "2.*" },, (*6)


2. In your command line, run `composer update`. 3. Follow Step 2 below. New Installation ---------------- 1. On your command line ```bash composer require "smalldogs/html5inputs:2.*"
  1. REPLACE the form alias with the new, extended facade, in app/config/app.php. ```php 'aliases' => array( 'Form' => 'Smalldogs\Html5inputs\Html5InputsFacade', // 'Form' => 'Illuminate\Support\Facades\Form', };

3. Add the service provider to your `app/config/app.php` providers array ```php 'providers' => array( 'Smalldogs\Html5inputs\Html5InputsServiceProvider', );

How to Use

Just like your normal Form interface., (*7)

// Create a date field
Form::date('yourBirthday');

// Create a pre-populated month field for June 2014
Form::month('hottestMonth', '2014-06');

// Create an empty input with bootstrap styles
Form::search('searchBox', null, ['class' => 'form-control']);

// Auto-associate label with input (use the same name)
Form::label('favoriteColor', 'Select Your Favorite Color');
Form::color('favoriteColor', '#FFAE25');


// Use Form-model binding
$user = new User();
$user->phoneNumber = '123-555-5555';
{{ Form::model($user) }}
    {{ Form::label('phoneNumber', 'Update Your Phone #') }}
    {{ Form::tel('phoneNumber') }}
{{ Form::close() }}

Changes from v1

The major difference between v1 and v2 is how the Form class is extended. Version 1 made use of the Form::macro method, while v2 creates a Facade which extends \Illuminate\Support\Facades\Form directly., (*8)

This allows for more direct similarity between the handling of the new methods and the default methods ( such as "text" or "email")., (*9)

This also enables Form Model Binding with the new HTML5 elements., (*10)

The Versions

20/11 2014

2.x-dev

2.9999999.9999999.9999999-dev https://blog.smalldo.gs/2014/04/laravel-4-html5-input-elements/

Adds support for all 11 remaining HTML5 elements (Laravel already supports 2 out of the box) using Laravels 4.2 Form interface (e.g. Form::date())

  Sources   Download

BSD-2-Clause

The Requires

 

laravel form helper input extend html5 form builder

20/11 2014

dev-master

9999999-dev https://blog.smalldo.gs/2014/04/laravel-4-html5-input-elements/

Adds support for all 11 remaining HTML5 elements (Laravel already supports 2 out of the box) using Laravels 4.2 Form interface (e.g. Form::date())

  Sources   Download

BSD-2-Clause

The Requires

 

laravel form helper input extend html5 form builder

20/11 2014

v1.2.0

1.2.0.0 https://blog.smalldo.gs/2014/04/laravel-4-html5-input-elements/

Adds support for all 11 remaining HTML5 elements (Laravel already supports 2 out of the box) using Laravels 4.2 Form interface (e.g. Form::date())

  Sources   Download

BSD-2-Clause

The Requires

 

laravel form helper input extend html5 form builder

20/11 2014

v2.0

2.0.0.0 https://blog.smalldo.gs/2014/04/laravel-4-html5-input-elements/

Adds support for all 11 remaining HTML5 elements (Laravel already supports 2 out of the box) using Laravels 4.2 Form interface (e.g. Form::date())

  Sources   Download

BSD-2-Clause

The Requires

 

laravel form helper input extend html5 form builder

20/11 2014

v2.1

2.1.0.0 https://blog.smalldo.gs/2014/04/laravel-4-html5-input-elements/

Adds support for all 11 remaining HTML5 elements (Laravel already supports 2 out of the box) using Laravels 4.2 Form interface (e.g. Form::date())

  Sources   Download

BSD-2-Clause

The Requires

 

laravel form helper input extend html5 form builder

20/11 2014

v3.0.0

3.0.0.0 https://blog.smalldo.gs/2014/04/laravel-4-html5-input-elements/

Adds support for all 11 remaining HTML5 elements (Laravel already supports 2 out of the box) using Laravels 4.2 Form interface (e.g. Form::date())

  Sources   Download

BSD-2-Clause

The Requires

 

laravel form helper input extend html5 form builder