OOjsUI
Object-Oriented JavaScript – User Interface
|
DOM element abstraction. More...
Public Member Functions | |
__construct (array $config=array()) | |
__call ($method, $arguments) | |
Call a mixed-in method. More... | |
__get ($name) | |
Get a mixed-in target property. More... | |
__isset ($name) | |
Check for existence of a mixed-in target property. More... | |
getTagName () | |
Get the HTML tag name. More... | |
getData () | |
Get element data. More... | |
setData ($data) | |
Set element data. More... | |
supports ($methods) | |
Check if element supports one or more methods. More... | |
mixin (ElementMixin $mixin) | |
Mixin a class. More... | |
getConfig (&$config) | |
Add the necessary properties to the given $config array to allow reconstruction of this widget via its constructor. More... | |
toString () | |
Render element into HTML. More... | |
![]() | |
__construct ($tag= 'div') | |
Create element. More... | |
hasClass ($class) | |
Check for CSS class. More... | |
addClasses (array $classes) | |
Add CSS classes. More... | |
removeClasses (array $classes) | |
Remove CSS classes. More... | |
toggleClasses (array $classes, $toggle=null) | |
Toggle CSS classes. More... | |
getAttribute ($key) | |
Get HTML attribute value. More... | |
setAttributes (array $attributes) | |
Add HTML attributes. More... | |
setValue ($value) | |
Set value of input element ('value' attribute for most, element content for textarea). More... | |
removeAttributes (array $keys) | |
Remove HTML attributes. More... | |
appendContent () | |
Add content to the end. More... | |
prependContent () | |
Add content to the beginning. More... | |
clearContent () | |
Remove all content. More... | |
getElementGroup () | |
Get group element is in. More... | |
setElementGroup ($group) | |
Set group element is in. More... | |
setInfusable ($infusable) | |
Enable widget for client-side infusion. More... | |
isInfusable () | |
Get client-side infusability. More... | |
ensureInfusableId () | |
Ensure that this given Tag is infusable and has a unique id attribute. More... | |
toString () | |
Render element into HTML. More... | |
__toString () | |
Magic method implementation. More... | |
Static Public Member Functions | |
static | getDir (Tag $element) |
Get the direction of the user interface for a given element. More... | |
static | setDefaultDir ($dir) |
Set the default direction of the user interface. More... | |
Static Public Attributes | |
static string | $tagName = 'div' |
HTML tag name. More... | |
static string | $defaultDir = 'ltr' |
Default text direction, used for some layout calculations. More... | |
Protected Member Functions | |
getJavaScriptClassName () | |
The class name of the JavaScript version of this widget. More... | |
getGeneratedAttributes () | |
![]() | |
getGeneratedAttributes () | |
Return an augmented attributes array, including synthetic attributes which are created from other properties (like the classes array) but which shouldn't be retained in the user-visible attributes . More... | |
Protected Attributes | |
mixed | $data = null |
Element data. | |
array | $ownClasses = array() |
Strings of the CSS classes explicitly configured for this element (as opposed to $classes, which contains all classes for this element). | |
array | $mixins = array() |
ElementMixins. More... | |
![]() | |
string | $tag = '' |
Tag name for this instance. More... | |
array | $attributes = array() |
Attributes. More... | |
array | $classes = array() |
Classes. More... | |
array | $content = array() |
Content. More... | |
GroupElement null | $elementGroup = null |
Group. More... | |
boolean | $infusable = false |
Infusion support. More... | |
DOM element abstraction.
OOUI\Element::__construct | ( | array | $config = array() | ) |
array | $config | Configuration options |
string[] | $config['classes'] CSS class names to add | |
string | $config,['id'] | HTML id attribute |
string | $config,['text'] | Text to insert |
array | $config,['content'] | Content to append (after text), strings or Element objects. Strings will be HTML-escaped for output, use an HtmlSnippet instance to prevent that. |
mixed | $config,['data'] | Element data |
OOUI\Element::__call | ( | $method, | |
$arguments | |||
) |
Call a mixed-in method.
This makes the methods of a mixin accessible through the element being mixed into.
Triggers an error if the method is not found, as normal.
string | $method | Method name |
array | $arguments | Method arguments |
OOUI\Element::__get | ( | $name | ) |
Get a mixed-in target property.
This makes the target of a mixin accessible through the element being mixed into.
The target's property name is statically configured by the mixin class.
Triggers a notice if the property is not found, as normal.
string | $name | Property name |
OOUI\Element::__isset | ( | $name | ) |
Check for existence of a mixed-in target property.
string | $name | Property name |
OOUI\Element::getConfig | ( | & | $config | ) |
Add the necessary properties to the given $config
array to allow reconstruction of this widget via its constructor.
array | &$config | An array which will be mutated to add the necessary configuration properties. Unless you are implementing a subclass, you should always pass a new empty array() . |
array_merge
in the implementation. OOUI\Element::getData | ( | ) |
Get element data.
|
static |
|
protected |
The class name of the JavaScript version of this widget.
OOUI\Element::getTagName | ( | ) |
Get the HTML tag name.
Override this method to base the result on instance information.
OOUI\Element::mixin | ( | ElementMixin | $mixin | ) |
Mixin a class.
ElementMixin | $mixin | Mixin object |
OOUI\Element::setData | ( | $data | ) |
|
static |
Set the default direction of the user interface.
OOUI\Element::supports | ( | $methods | ) |
Check if element supports one or more methods.
string|string[] | $methods Method or list of methods to check |
OOUI\Element::toString | ( | ) |
Render element into HTML.
|
static |
Default text direction, used for some layout calculations.
Use setDefaultDir() to change.
Currently only per-document directionality is supported.
|
protected |
ElementMixins.
List mixed in objects.
|
static |
HTML tag name.
This may be ignored if getTagName() is overridden.