Skip to content

Commit

Permalink
added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Sep 14, 2014
1 parent e3d6fc1 commit 22f510a
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions README.md
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)

0 comments on commit 22f510a

Please sign in to comment.