Bootstrap
Decorator base class
- Full name:
\Qubus\Form\FormBuilder\Decorator\Bootstrap - Parent class:
\Qubus\Form\FormBuilder\Decorator
Properties
defaultFontset
Prefix for the default fontawesome fontset.
- This property is static.
Methods
__construct
Class constructor
Parameters:
| Parameter | Type | Description |
|---|---|---|
$options | array |
Throws:
isDeep
Whether to apply the decorator to all descendants.
apply
Apply modifications
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element | |
$deep | bool |
Throws:
applyToElement
Apply modifications to element
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element |
Throws:
applyToAddon
Render prepend or append HTML.
protected applyToAddon(string $placement, \Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents $element): void
Parameters:
| Parameter | Type | Description |
|---|---|---|
$placement | string | |
$element | \Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents |
Throws:
applyToLabel
Apply modifications to label
public applyToLabel(\Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents $element): void
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents |
applyToContainer
Apply modifications to container
public applyToContainer(\Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents $element): void
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents |
renderContent
Render the content of the element control to HTML.
public renderContent(\Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents $element, string $html): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents | |
$html | string | Original rendered html |
render
Render the element control to HTML.
public render(\Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents $element, string $html): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents | |
$html | string | Original rendered html |
Throws:
renderControl
Render form control
protected renderControl(\Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents $element, \Qubus\Form\FormBuilder\Group $container): void
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element|\Qubus\Form\FormBuilder\WithComponents | |
$container | \Qubus\Form\FormBuilder\Group |
Throws:
isButton
Check if element is a button
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element |
register
Register Boostrap decorator and elements
- This method is static.
icon
HTML for font icons (like FontAwesome)
- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$icon | string | Icon name (and other options) |
$fontset | string|null | Prefix for fonts |
Inherited methods
isDeep
Whether to apply the decorator to all descendants.
apply
Apply modifications.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element | |
$deep | bool | The decorator of a parent is applied to a child. |
validate
Validate the element
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element | |
$valid | bool | Result of FormBuilder validation. |
filter
Modify the value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element | |
$value | mixed |
render
Render to HTML
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element | |
$html | string | Original rendered html. |
renderContent
Render the element content to HTML
Parameters:
| Parameter | Type | Description |
|---|---|---|
$element | \Qubus\Form\FormBuilder\Element | |
$html | string | Original rendered html. |
applyToValidationScript
Parameters:
| Parameter | Type | Description |
|---|---|---|
$param | \Qubus\Form\FormBuilder\Control | |
$rules | array |