forked from oscarotero/form-manager-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3d6fc1
commit 22f510a
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
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](https://github.com/oscarotero/form-manager) library to generate bootstrap forms easily | ||
|
||
Usage | ||
--------------- | ||
|
||
```php | ||
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: | ||
|
||
```php | ||
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 | ||
|
||
```php | ||
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: | ||
|
||
* [FormManager library](https://github.com/oscarotero/form-manager) | ||
* [Bootstrap forms](http://getbootstrap.com/css/#forms) |