Download the PHP package valksystems/bootbuilder without Composer
On this page you can find all versions of the php package valksystems/bootbuilder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download valksystems/bootbuilder
More information about valksystems/bootbuilder
Files in valksystems/bootbuilder
Package bootbuilder
Short Description Easy bootstrap form builder in PHP.
License MIT
Informations about the package bootbuilder
BootBuilder
Bootstrap Form Building made easy in PHP.
Installation
You can install the package with Composer, check out composer on http://getcomposer.org
Add the following to the required in the composer.json:
Or execute the following composer command:
Usage
Checkout the demo folder for demo's with the controls and different styles of forms
Forms
First of all, you have to create a Form object. There are 2 options right now. Just a normal form and a horizontal form (look at bootstrap page for more information).
To create a form use:
On the form object you can set the properties of a normal form with the following methods:
To add controls or panes to the form, use:
HorizontalForm
On a horizontal form you can set 2 more parameters for the grid layout. To set the layout parameters, use the following methods:
Rendering
To render the form you simply call . You can also get the rendered HTML back with .
Controls
You can use the following controls, in fully bootstrap styles:
- Button
- Submit (Button)
- Checkbox
- Radio
- Text (input type=text)
- Number (input type=number)
- Email (input type=email)
- TextArea
- Hidden (input type=hidden)
- Password (input type=password)
- Select
Default operations on controls
To create a new control. Construct the class for the control with:
On all the controls you can set the name, id, class(es), value, placeholder, label text, required (y/n), disabled (y/n), readonly (y/n), errorstate (y/n) and helptext with simple methods:
After creating you can either add it to a pane or to the form directly.
Text
You can enter a custom type of input now, with the method
TextArea
On a TextArea object you can set the optional rows parameter with the method
Select
To set the data in the select control (the options), use the following method:
The $options need to have an array with: [value] = "Readable text".
Panes
You can combine controls with panes, it's like an group with elements, but specific with the style it has. Currently there are 2 panes, StackPane and InlinePane
To create a pane and add controls to it use:
StackPane
StackPane will combine elements, each on a new row. Just adding it below it.
InlinePane
InlinePane will make the supported controls (checkbox and radio) display with an in-line style. See http://getbootstrap.com/css/?#inline-checkboxes-and-radios for more information.
License
This project is under MIT License, see LICENSE file.
Resposibility
We are not resposible for any security problems, always check code before you are going to use it!