Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 1.37 KB

README.md

File metadata and controls

61 lines (42 loc) · 1.37 KB

FormManager\Bootstrap

Created by Oscar Otero http://oscarotero.com [email protected]

Requirements:

  • PHP 5.4
  • Composer or any PSR-4 autoloader

This is a extension of FormManager library to generate bootstrap forms easily

Usage

use FormManager\Bootstrap;

$myForm = Bootstrap::form([
	'name' => Bootstrap::text()->label('Your name'),
	'email' => Bootstrap::email()->label('Your email')
]);

echo $myForm;

You can generate horizontal forms and inline forms:

use FormManager\Bootstrap;

$myHorizontalForm = Bootstrap::formHorizontal($fields);
$myInlineForm = Bootstrap::formInline($fields);

Use set method to customize each field. The available properties:

  • size: (sm|lg) To create small/large fields
  • addon-before: To insert an addon before the input
  • addon-after: To insert an addon after the input
  • help: To insert a help block before the input
use FormManager\Bootstrap;

$myForm = Bootstrap::form([
	'name' => Bootstrap::text()->label('Your name')->set('size', 'lg'),
	'email' => Bootstrap::email()->label('Your email')->set([
		'addon-before' => '@',
		'help' => 'Insert here your email'
	])
]);

echo $myForm;

More information: