2017 © Pedro Peláez
 

library bselements

Bootstrap shortcuts and elements for Laravel

image

alexwenzel/bselements

Bootstrap shortcuts and elements for Laravel

  • Friday, June 20, 2014
  • by alexwenzel
  • Repository
  • 0 Watchers
  • 0 Stars
  • 138 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Laravel form elements for quick prototyping

This package provides form elements for Laravel 4.2, which are styled with Bootstrap 3., (*1)

  • shows first error message in help text area
  • labels the input with the error class
  • automatically repopulates the form elements

There is a demo page included in this package: use View::make('bselements::demopage')., (*2)

Example

{{ BsForm::useViewErrorBag($errors) }}
{{ BsForm::info('Info', 'Infotext', array()) }}
{{ BsForm::text('text', 'Text') }}
{{ BsForm::textAddon('left', 'Demo', 'textaddon1', 'Text-Addon') }}
{{ BsForm::textAddon('right', 'Demo', 'textaddon2', 'Text-Addon') }}
{{ BsForm::password('password', 'Password') }}
{{ BsForm::file('file', 'File') }}
{{ BsForm::select('select', 'Select', array(''=>'-- Choose --','s1'=>'Select 1','s2'=>'Select 2','s3'=>'Select 3')) }}
{{ BsForm::textarea('textarea', 'Textarea') }}
{{ BsForm::radioGroup('radiogroup', 'radioGroup', array('r1'=>'1','r2'=>'2','r3'=>'3')) }}
{{ BsForm::checkboxGroup('checkboxGroup', array('c1'=>'one','c2'=>'two','c3'=>'three')) }}

checkbox, (*3)

checkbox, (*4)

Usage

First register the service provider Alexwenzel\Bselements\BselementsServiceProvider in app/conf/app.php., (*5)

Then you can use it with the following syntax:, (*6)

`````php {{ BsForm::text('text', 'Text') }}, (*7)


Bootstrap assets (CSS/JS) are not included! Include them yourself. ## Form elements ### Injecting validation messages You can inject your validation messages within you template into the BsForm class. ````php BsForm::useViewErrorBag($errors)

Info

Generates a text input look-alike field, without any functionality., (*8)

BsForm::info($label, $text, array $attributes = array())

Text

Generates a text input element., (*9)

BsForm::text($id, $label, array $attributes = array())

Text Addon

Generates a text input element with addon., (*10)

BsForm::textAddon($addonDirection, $addonContent, $id, $label, array $attributes = array())
  • $addonDirection can be left or right
  • $addonContent can be any HTML/String

File

Generates a file input element., (*11)

BsForm::file($id, $label, array $attributes = array())

Select

Generates a select element., (*12)

BsForm::select($id, $label, array $elements, array $attributes = array())

Password

Generates a password input element., (*13)

BsForm::password($id, $label, array $attributes = array())

Textarea

Generates a textarea element., (*14)

BsForm::textarea($id, $label, array $attributes = array())

Radio Group

Generates a group of radio elements., (*15)

BsForm::radioGroup($id, $label, array $values)

Checkbox Group

Generates a group of checkbox elements., (*16)

BsForm::checkboxGroup($label, array $values)

The Versions

20/06 2014

dev-master

9999999-dev

Bootstrap shortcuts and elements for Laravel

  Sources   Download

GPL-2

The Requires

 

by Avatar alexwenzel

laravel bootstrap

20/06 2014

dev-development

dev-development

Bootstrap shortcuts and elements for Laravel

  Sources   Download

GPL-2

The Requires

 

by Avatar alexwenzel

laravel bootstrap

20/06 2014

v1.2.0

1.2.0.0

Bootstrap shortcuts and elements for Laravel

  Sources   Download

GPL-2

The Requires

 

by Avatar alexwenzel

laravel bootstrap

11/06 2014

v1.1.0

1.1.0.0

Bootstrap shortcuts and elements for Laravel

  Sources   Download

GPL-2

The Requires

 

by Avatar alexwenzel

laravel bootstrap

14/04 2014

v1.0.0

1.0.0.0

Bootstrap shortcuts and elements for Laravel

  Sources   Download

GPL-2

The Requires

 

by Avatar alexwenzel

laravel bootstrap

28/03 2014

v0.1

0.1.0.0

Bootstrap shortcuts and elements for Laravel

  Sources   Download

MIT

The Requires

 

by Avatar alexwenzel

laravel bootstrap