form-manager / bootstrap
FormManager extension to create bootstrap like forms
Installs: 6 126
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 2
Open Issues: 1
Requires
- form-manager/form-manager: 4.3.*
README
Created by Oscar Otero http://oscarotero.com oom@oscarotero.com
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: