◆ __construct()
__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. |
◆ addClass()
Adds a css class to the rendered element.
- Parameters
-
string | $clas | CSS class to add |
- Returns
- LinkElement instance to allow chaining
◆ asButton()
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
◆ asDialog()
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
◆ fromHTML()
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 |
◆ isDisabled()
Returns whether the element is disabled.
- Returns
- bool
◆ isURL()
Returns whether the given url is valid.
- Parameters
-
- Returns
- bool
◆ parseAttributes()
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
◆ render()
Renders the element.
- Returns
- string
◆ renderButton()
Renders the element as a button/form.
- Returns
- string
◆ setActive()
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()
setDisabled |
( |
|
$state = true | ) |
|
Set disabled state
- Parameters
-
boolean | $state | Disabled state |
- Returns
- LinkElement instance to allow chaining
◆ setTarget()
Sets the target attribute of the element.
- Parameters
-
string | $target | Target attribute |
- Returns
- LinkElement instance to allow chaining
◆ $active
◆ $as_button
◆ $icon
◆ $label
◆ $url
The documentation for this class was generated from the following file: