__construct |
( |
|
$label, |
|
|
|
$url, |
|
|
\Icon |
$icon = null , |
|
|
|
$attributes = [] |
|
) |
| |
create a link for a widget
- Parameters
-
String | $label | Label/content of the link |
String | $url | URL/Location of the link (raw url, no entities) |
Icon | $icon | Icon for the link |
array | $attributes | HTML-attributes for the a-tag in an associative array. |
Adds a css class to the rendered element.
- Parameters
-
string | $clas | CSS class to add |
- Returns
- LinkElement instance to allow chaining
asButton |
( |
|
$state = true | ) |
|
Defines whether the link should be rendered as a button/form with POST method.
- Parameters
-
bool | $active | State (optional, defaults to true) |
- Returns
- LinkElement instance to allow chaining
Sets the dialog options for the element. Passing false as $state will reset the dialog options to "none".
- Parameters
-
mixed | $active | Dialog options (optional, defaults to blank/standard dialog) |
- Returns
- LinkElement instance to allow chaining
static fromHTML |
( |
|
$html, |
|
|
\Icon |
$icon = null |
|
) |
| |
|
static |
Create link by parsing a html chunk.
- Parameters
-
String | $html | HTML chunk to parse |
Icon | $icon | Optional icon |
- Returns
- LinkElement Link element from parsed html
- Exceptions
-
Exception | if html can not be parsed |
Returns whether the element is disabled.
- Returns
- bool
Returns whether the given url is valid.
- Parameters
-
- Returns
- bool
offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
static parseAttributes |
( |
|
$text | ) |
|
|
staticprotected |
Parse a string of html attributes into an associative array.
- Parameters
-
String | $text | String of html attributes |
- Returns
- Array parsed attributes as key => value pairs
- See Also
- https://gist.github.com/rodneyrehm/3070128
Renders the element.
- Returns
- string
Renders the element as a button/form.
- Returns
- string
setActive |
( |
|
$active = true | ) |
|
Sets the active state of the element.
- Parameters
-
bool | $active | Active state (optional, defaults to true) |
- Returns
- LinkElement instance to allow chaining
setDisabled |
( |
|
$state = true | ) |
|
Set disabled state
- Parameters
-
boolean | $state | Disabled state |
- Returns
- LinkElement instance to allow chaining
Sets the target attribute of the element.
- Parameters
-
string | $target | Target attribute |
- Returns
- LinkElement instance to allow chaining
The documentation for this class was generated from the following file: