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_BUTTON | button |
UI_button::TYPE_SUBMIT | submit |
UI_button::TYPE_RESET | reset |
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_PRIMARY | primary |
UI_button::CLASS_SECONDARY | secondary |
UI_button::CLASS_SUCCESS | success |
UI_button::CLASS_DANGER | danger |
UI_button::CLASS_WARNING | warning |
UI_button::CLASS_INFO | info |
UI_button::CLASS_LIGHT | light |
UI_button::CLASS_DARK | dark |
UI_button::CLASS_LINK | link |
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_LARGE | lg |
UI_button::SIZE_NORMAL | normal |
UI_button::SIZE_SMALL | sm |
UI_button::SIZE_EXTRA_SMALL | xs |
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 |