Button
in package
Button HTML custom widget.
Tags
Table of Contents
Properties
- $action : string
- The Javascript action to carry out when the button is pressed.
- $iconCSS : string
- If provided, the Bootsrap CSS icon class(s) to use for this button.
- $id : string
- The HTML id attribute for the button.
- $imgURL : string
- If provided, the button will be a clickable image using this image.
- $title : string
- The title to display on the button.
- $tooltip : string
- If provided, the Bootsrap tooltip to use for this button.
- $tooltipPosition : string
- If provided, the Bootsrap tooltip position (left|right|top|bottom) to use for this button.
Methods
- __construct() : mixed
- The constructor.
- render() : string
- Renders the HTML and javascript for the button.
Properties
$action
The Javascript action to carry out when the button is pressed.
private
string
$action
Tags
$iconCSS
If provided, the Bootsrap CSS icon class(s) to use for this button.
private
string
$iconCSS
Tags
$id
The HTML id attribute for the button.
private
string
$id
Tags
$imgURL
If provided, the button will be a clickable image using this image.
private
string
$imgURL
Tags
$title
The title to display on the button.
private
string
$title
Tags
$tooltip
If provided, the Bootsrap tooltip to use for this button.
private
string
$tooltip
Tags
$tooltipPosition
If provided, the Bootsrap tooltip position (left|right|top|bottom) to use for this button.
private
string
$tooltipPosition
Tags
Methods
__construct()
The constructor.
public
__construct(string $action, string $title, string $id[, string $imgURL = '' ][, string $iconCSS = '' ][, string $tooltip = '' ][, string $tooltipPosition = '' ]) : mixed
Parameters
- $action : string
-
The javascript action to be carried out (or set to "submit" to make a submit button, "file" for file uploads).
- $title : string
-
The title to appear on the button.
- $id : string
-
The HTML id attribute for the button.
- $imgURL : string = ''
-
If provided, the button will be a clickable image using this image.
- $iconCSS : string = ''
-
If provided, the Bootsrap iconCSS to use for this button.
- $tooltip : string = ''
-
If provided, the Bootsrap tooltip to use for this button.
- $tooltipPosition : string = ''
-
If provided, the Bootsrap tooltip position (left|right|top|bottom) to use for this button.
Tags
render()
Renders the HTML and javascript for the button.
public
render([int $width = 0 ][, string $cssClasses = 'btn btn-primary' ]) : string
Parameters
- $width : int = 0
-
The width in pixels of the button (will also accept percentage values), defaults to 0 meaning auto-width to fit text.
- $cssClasses : string = 'btn btn-primary'
-
List of CSS classes to apply to the button (optional)