2017 © Pedro Peláez
 

library bootforms

Generate HTML form structure for use with Twitter Bootstrap

image

kilrizzy/bootforms

Generate HTML form structure for use with Twitter Bootstrap

  • Monday, December 9, 2013
  • by kilrizzy
  • Repository
  • 2 Watchers
  • 8 Stars
  • 152 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Heads Up!

I built this package as a helper to make my projects easier, since then I have found a package that seems to do what bootforms aims for and much more., (*1)

I highly recommend taking a peek at Anahkiasen/former to see if this better suits your project, (*2)

Bootforms

Bootstrap form field generator for Laravel 4. Bootforms will add "controls", labels, and "group" html elements to your form fields to make integration with Bootstrap quicker and easier., (*3)

Turning This:, (*4)

{{ Bootform::field(array(
  'label'       => "Full Name",
  'name'        => "name",
)) }}
{{ Bootform::field(array(
    'label'       => "Email Address",
    'name'        => "email",
    'input-prepend' => '<i class="icon-envelope"></i>',
    'input-attributes' => array('placeholder' => "example@example.com"),
    'input-class' => "input-large"
  )) }}

Into This:, (*5)

<div class="control-group field-group-text control-group-name">
  <label for="name" class="control-label ">Full Name</label>
  <div class="controls" >
    <input class="" name="name" type="text" value="">
  </div>
</div>
<div class="control-group  field-group-text control-group-email">
  <label for="email" class="control-label ">Email Address</label>
  <div class="controls input-prepend" >
    <span class="add-on"><i class="icon-envelope"></i></span>
    <input class="input-large" placeholder="example@example.com" name="email" type="text" value="">
  </div>
</div>

Bootforms uses Laravel's Form class to generate form fields., (*6)

Installation

Add kilrizzy/bootforms to composer.json., (*7)

"kilrizzy/bootforms": "dev-master"

Run composer update to pull down the latest version of Bootforms., (*8)

Open app/config/app.php and add service provider:, (*9)

'Kilrizzy\Bootforms\BootformsServiceProvider',

In app/config/app.php add alias:, (*10)

'Bootform' => 'Kilrizzy\Bootforms\BootformsFacade',

Usage

Pass an array of field data to Bootforms to generate html using the following options:, (*11)

$options = array(
  'type' => "text", //field input type (text, textarea, password, select, checkbox, radio, file)
  'name' => "", //field input name
  'id' => "", //field input id
  'value' => "", //field input value
  'label' => "", //field label
  'help' => "", //field help display text
  'label-class' => "", //label class
  'group' => true, //wrap group
  'group-class' => "", //class applied to the group container
  'group-attributes' => array(), //additional group attributes
  'controls' => true, //wrap controls
  'controls-class' => "", //class applied to the controls container
  'controls-attributes' => array(), //additional controls attributes
  'input-class' => "", //class applied to the input
  'input-attributes' => array(), //additional input attributes
  'input-prepend' => "", //prepend control data
  'input-append' => "", //append control data
);

Take a look at demo/bootforms.blade.php for an example view, (*12)

Bitdeli Badge, (*13)

The Versions

09/12 2013

dev-master

9999999-dev

Generate HTML form structure for use with Twitter Bootstrap

  Sources   Download

BSD-2-Clause

The Requires

 

laravel bootstrap forms