Form Element Types
All elements falls under this two prototypes.
Variable |
Type |
Description |
$label |
String |
Element label in the form. In case of the 'Vertical' view usage, element label will be rendered as a placeholder |
$id |
String |
Element ID. If name were not set separately, name will be set to the same value as id. If not set, default id will {$formId}-elem-{$elementCount} |
$options |
Array |
Used in elements like Option,Radio,Select. Array could be an associative array or a usual array |
$attributes |
Array |
All elements support all html attributes (including data attributes and html5 validation attributes) plus following library specific attributes: |
Library specific attributes:
Attribute |
Type |
Description |
append |
String |
Append addon to the end of element. Ex: "prepend" => "<span class='glyphicon glyphicon-earphone'></span>" |
prepend |
String |
Prepend addon to the begining of element. Ex: "prepend" => "<span class='glyphicon glyphicon-earphone'></span>" |
inline |
boolean |
Used in radio and option elements. Indicates if element values should be rendered inline or one after another |
minlength |
int |
Minimal length validation. No support on client side validation, only server side for now |
shared |
String |
Element row should be shared between current and next elements. Value should contain bootstrap bootstrap col- sizing definitions. Ex: 'col-xs-5 col-md-4' if you want to fit 2 elements. Note that maximum row size here is 'col-xs-10 colo-md-8'. If bigger size will be specified, your form will be misaligned. See views description for more information. |
validation |
object |
Validation object. Ex: "validation" => new Validation_Numeric(). |