Jet\UI_button

Renderer of the general button. Inherits from Jet\UI_Renderer_Single.

Functional types of buttons

Button type in the sense of its functionality and parameters type HTML tag button.

Constanta Value
UI_button::TYPE_BUTTONbutton
UI_button::TYPE_SUBMITsubmit
UI_button::TYPE_RESETreset

Other buttons in terms of appearance

The predefined types are based on the Bootstrap framework.

However, they can be interpreted in any way, just as you can define other types.

Constant Value
UI_button::CLASS_PRIMARYprimary
UI_button::CLASS_SECONDARYsecondary
UI_button::CLASS_SUCCESSsuccess
UI_button::CLASS_DANGERdanger
UI_button::CLASS_WARNINGwarning
UI_button::CLASS_INFOinfo
UI_button::CLASS_LIGHTlight
UI_button::CLASS_DARKdark
UI_button::CLASS_LINKlink

Sizes

The look and feel as well as button sizes are based on the Bootstrap framework.

Also the sizes can be interpreted in the view in any way, or you can define your own size.

Constant Value
UI_button::SIZE_LARGElg
UI_button::SIZE_NORMALnormal
UI_button::SIZE_SMALLsm
UI_button::SIZE_EXTRA_SMALLxs

Overview of methods

Method Meaning of
public __construct(
string $label
)
The only parameter is the button label.
public setLabel(
string $label
) : static
Sets the button label
public getLabel(
) : string
Returns the button label
public setType(
string $type
) : static
Sets the button type (in terms of its functionality).
public getType(
) : string
Returns the set button type (in terms of its functionality).
public setClass(
string $class
) : static
Sets the button appearance class.
public getClass(
) : string
Returns the set button appearance class.
public setSize(
string $size
) : static
Sets the size of the button.
public getSize(
) : string
Returns the set button size.
public setIcon(
string $icon
) : static
Sets the button icon (the icon name that is then interpreted in the view).
public getIcon(
) : string
Returns the set button icon.
public setOnClick(
string $onclick
) : static
Alias for calling ->addJsAction('onclick'"alert('click');");
public setUrl(
string $url
) : static
Sets the URL and thus the button effectively becomes a link in the visual form of a button.
public getUrl(
) : string
Returns the set URL - see the setUrl method
Previous chapter
Jet\UI_badge
Next chapter
Jet\UI_button_create