Data structure representing a simple form with only one button.
More...
|
string | $actionid |
| Action id.
|
|
array | $actions = array() |
| List of attached actions.
|
|
string | $class = 'singlebutton' |
| Wrapping div class.
|
|
bool | $disabled = false |
| True if button disabled, false if normal.
|
|
string | $formid |
| Form id.
|
|
string | $label |
| Button label.
|
|
string | $method = 'post' |
| Form submit method post or get.
|
|
array | $params |
| $params URL Params
|
|
bool | $primary = false |
| True if button is primary button.
|
|
string | $tooltip = null |
| Button tooltip.
|
|
moodle_url | $url |
| Target url.
|
|
Data structure representing a simple form with only one button.
- Copyright
- 2009 Petr Skoda
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- Since
- Moodle 2.0
◆ __construct()
single_button::__construct |
( |
moodle_url | $url, |
|
|
| $label, |
|
|
| $method = 'post', |
|
|
| $primary = false, |
|
|
| $attributes = [] ) |
Constructor.
- Parameters
-
moodle_url | $url | |
string | $label | button text |
string | $method | get or post submit method |
bool | $primary | whether this is a primary button, used for styling |
array | $attributes | Attributes for the HTML button tag |
◆ add_action()
Add action to the button.
- Parameters
-
◆ add_confirm_action()
single_button::add_confirm_action |
( |
| $confirmmessage | ) |
|
Shortcut for adding a JS confirm dialog when the button is clicked.
The message must be a yes/no question.
- Parameters
-
string | $confirmmessage | The yes/no confirmation question. If "Yes" is clicked, the original action will occur. |
◆ export_for_template()
Export data.
- Parameters
-
- Return values
-
◆ set_attribute()
single_button::set_attribute |
( |
| $name, |
|
|
| $value ) |
Sets an attribute for the HTML button tag.
- Parameters
-
string | $name | The attribute name |
mixed | $value | The value |
- Return values
-
◆ $primary
bool single_button::$primary = false |
True if button is primary button.
Used for styling.
The documentation for this class was generated from the following file: