jarnstedt / former by jarnstedt

Laravel 4 form builder with Twitter Bootstrap styling
75
4
2
Package Data
Maintainer Username: jarnstedt
Maintainer Contact: joonas@xnetti.net (Joonas Järnstedt)
Package Create Date: 2014-06-05
Package Last Update: 2014-12-10
Language: PHP
License: MIT
Last Refreshed: 2024-12-11 15:17:10
Package Statistics
Total Downloads: 75
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 4
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Former Build Status

Laravel 4 form builder with Twitter Bootstrap styling. Extends Laravels own form builder.

  • Set form defaults
  • Repopulate forms
  • Show validation errors

Install

Add this to composer.json and run composer update.

"require": {
   "jarnstedt/former": "dev-master"
},

Add this to Laravel providers array in app/config/app.php file.

'Jarnstedt\Former\FormerServiceProvider',

Add this to aliases array.

'Former' => 'Jarnstedt\Former\FormerFacade'

Usage

Example form

// controller
$user = User::find(1);
$form = Former::make($user);

// view
{{ $form->open() }}
{{ $form->text('name', 'Your name.req', 'default value', array('class' => 'className')) }}
{{ $form->select('city', 'City', array('City1', 'City2')) }}
{{ $form->submit('Save') }}
{{ $form->close() }}