This class represent an action that is associated with a certain widget.
- Author
- Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL2 or any later version
- Since
- Stud.IP 4.1
◆ __construct()
__construct |
( |
|
$label, |
|
|
callable |
$callback = null , |
|
|
array |
$attributes = [] |
|
) |
| |
Constructs the action.
- Parameters
-
string | $label | Label/name of the action |
callable | $callback | Callback to execute when the action is executed |
array | $attributes | Optional additional attributes for the rendered action element |
◆ getAdminMode()
Returns whether this action requires admin mode.
- Returns
- bool
◆ getAttributes()
Returns the defined attributes of this action.
- Returns
- array
◆ getCallback()
Returns the defined callback of this action.
- Returns
- WidgetAction or null
◆ getIcon()
Returns the defined action for this action.
- Returns
- Icon instance or null if no icon has been defined.
◆ getLabel()
Returns the label/name of this action.
- Returns
- string
◆ hasIcon()
hasIcon |
( |
|
$has_icon = null | ) |
|
Returns whether an icon has been defined if no parameters is passed or sets whether an icon is defined if a parameter is passed.
- Parameters
-
mixed | $has_icon | Optional state to set |
- Returns
- mixed Current state if no parameter is set
- Todo:
- This seems rather nasty.
◆ invokeCallback()
invokeCallback |
( |
array |
$arguments | ) |
|
Invokes the defined callback for this action.
- Parameters
-
array | $arguments | Additional arguments to pass to the callback |
- Returns
- mixed whatever the callback might return or null if no callback was defined
◆ setAdminMode()
setAdminMode |
( |
|
$state = true | ) |
|
Defines whether this action requires admin mode.
- Parameters
-
◆ setAttributes()
setAttributes |
( |
array |
$attributes | ) |
|
Sets the attributes for the rendered html element.
- Parameters
-
array | $attributes | Set of attributes |
- Returns
- WidgetAction instance to allow chaining
◆ setCallback()
setCallback |
( |
callable |
$callback | ) |
|
Sets the callback to execute to execute when this action is executed.
- Parameters
-
callbacke | $callback | Callback to execute when this action is executed |
- Returns
- WidgetAction instance to allow chaining
◆ setIcon()
Defines an icon for the action.
- Parameters
-
◆ setLabel()
Sets the label/name for this action.
- Parameters
-
string | $label | Label/name of the action |
- Returns
- WidgetAction instance to allow chaining
◆ $admin_mode
◆ $attributes
◆ $callback
◆ $has_icon
◆ $label
The documentation for this class was generated from the following file: