Class Element
An HTML element.
The Element class can create any kind of HTML element. It
supports class names, dataset, children. It handles values and default values.
It can decorate the HTML element with a label, a legend and a description.
- ICanBoogie\Object
-
Brickrouge\Element
implements
ArrayAccess,
IteratorAggregate
Direct known subclasses
Brickrouge\A,
Brickrouge\Actions,
Brickrouge\Ranger,
Brickrouge\Renderer\Simple,
Brickrouge\Salutation,
Brickrouge\Searchbox,
Brickrouge\SplitButton,
Brickrouge\Text,
Brickrouge\Alert,
Brickrouge\Button,
Brickrouge\DateRange,
Brickrouge\DropdownMenu,
Brickrouge\Form,
Brickrouge\Group,
Brickrouge\Pager,
Brickrouge\Popover
Indirect known subclasses
Brickrouge\Date,
Brickrouge\DateTime,
Brickrouge\PopoverWidget
See: http://dev.w3.org/html5/spec/Overview.html#embedding-custom-non-visible-data-with-the-data-attributes
Located at lib/element.php
Methods summary
public
|
|
protected
|
|
protected
|
|
protected
|
|
public
boolean
|
|
public
mixed|null
|
|
public
|
|
public
|
|
public
|
|
public static
string
|
|
protected
string
|
|
protected
string
|
|
protected
|
|
public
|
|
public
|
|
public
boolean
|
|
protected
array
|
|
protected
string
|
|
protected
|
|
public
|
#
adopt( string|
Add a child or children to the element. |
public
array[int]Element|string
|
|
protected
string
|
#
render_child(
Returns the HTML representation of a child element. |
protected
string
|
|
protected
string|null
|
|
protected
string
|
|
protected
string
|
|
protected
string
|
|
protected
|
|
protected
array
|
#
alter_attributes( array $attributes )
The |
protected
string
|
|
protected
array
|
|
protected
string
|
|
protected
string
|
|
protected
string
|
|
protected
string
|
#
decorate_with_label( string $html, string $label )
Decorates the specified HTML with specified label. |
protected
string
|
#
decorate_with_legend( string $html, string $legend )
Decorates the specified HTML with a fieldset and the specified legend. |
protected
string
|
#
decorate_with_inline_help( string $html, string $help )
Decorates the specified HTML with an inline help element. |
protected
string
|
#
decorate_with_description( string $html, string $description )
Decorates the specified HTML with the specified description. |
protected static
|
|
protected static
|
|
public
string
|
|
public
boolean
|
Methods inherited from ICanBoogie\Object
__get(),
__set(),
__unset(),
has_property()
Constants summary
string
|
TYPE_CHECKBOX
|
'#checkbox' |
#
Custom type used to create checkbox elements. |
string
|
TYPE_CHECKBOX_GROUP
|
'#checkbox-group' |
#
Custom type used to create checkbox group elements. |
string
|
TYPE_FILE
|
'#file' |
#
Custom type used to create file elements. |
string
|
TYPE_RADIO
|
'#radio' |
#
Custom type used to create radio elements. |
string
|
TYPE_RADIO_GROUP
|
'#radio-group' |
#
Custom type used to create radio group elements. |
string
|
CHILDREN
|
'#children' |
#
Used to define the children of an element. |
string
|
DEFAULT_VALUE
|
'#default-value' |
#
Used to define the default value of an element. |
string
|
DESCRIPTION
|
'#description' |
#
Used to define the description block of an element. |
string
|
FILE_WITH_LIMIT
|
'#file-with-limit' |
|
string
|
FILE_WITH_REMINDER
|
'#file-with-reminder' |
|
string
|
GROUP
|
'#group' |
#
Used to define the group of an element. |
string
|
GROUPS
|
'#groups' |
#
Used to define the groups that can be used by children elements. |
string
|
INLINE_HELP
|
'#inline-help' |
#
Used to define the inline help of an element. |
string
|
INNER_HTML
|
'#inner-html' |
#
Used to define the inner HTML of an element. If the value of the tag is null, the markup will be self-closing. |
string
|
LABEL
|
'#label' |
#
Used to define the label of an element. |
string
|
LABEL_POSITION
|
'#label-position' |
#
Used to define the position of the label. Possible positions are "before", "after" and "above". Defaults to "after". |
string
|
LABEL_SEPARATOR
|
'#label-separator' |
|
string
|
LABEL_MISSING
|
'#label-missing' |
|
string
|
LEGEND
|
'#element-legend' |
#
Used to define the legend of an element. If the legend is defined the element is wrapped into a fieldset when it is rendered. |
string
|
REQUIRED
|
'required' |
#
Used to define the required state of an element. |
string
|
OPTIONS
|
'#options' |
#
Used to define the options of the following element types: "select", |
string
|
OPTIONS_DISABLED
|
'#options-disabled' |
#
Used to define which options are disabled. |
string
|
STATE
|
'#state' |
#
Used to define the state of the element: "success", "warning" or "error". |
string
|
VALIDATOR
|
'#validator' |
#
Used to define the validator of an element. The validator is defined using an array made of a callback and a possible userdata array. |
string
|
VALIDATOR_OPTIONS
|
'#validator-options' |
|
string
|
WEIGHT
|
'#weight' |
#
Use to define the weight of an element. This attribute can be used to reorder children when a parent element is rendered. |
string
|
WIDGET_CONSTRUCTOR
|
'#widget-constructor' |
#
The name of the Javascript constructor that should be used to construct the widget. |
Properties summary
public
string
|
$type | |
#
Type if the element, as provided during |
protected
string
|
$tag_name | |
#
Tag name of the rendered HTML element. |
public
array
|
$children | array() |
#
An array containing the children of the element. |
protected
array[string]mixed
|
$tags | array() |
#
Tags of the element, including HTML and special attributes. |
protected
string|null
|
$inner_html | |
#
Inner HTML of the element. |
protected static
integer
|
$auto_element_id | 1 |
#
Next available auto element id index. |
protected
array
|
$class_names | array() |
#
Class names used to compose the value of the |