PHP Class macgyer\yii2materializecss\widgets\Button

There are three main button types described in Materialize. - the raised button is a standard button that signifies actions and seek to give depth to a mostly flat page - the floating circular action button is meant for very important functions - flat buttons are usually used within elements that already have depth like cards or modals The button can be displayed with an optional icon. This class uses the [[Icon|Icon]] widget to show icons.
See also: http://materializecss.com/buttons.html
Author: Christoph Erdmann ([email protected])
Inheritance: extends macgyer\yii2materializecss\lib\BaseWidget
Datei anzeigen Open project: macgyer/yii2-materializecss Class Usage Examples

Public Properties

Property Type Description
$disabled whether the button shall be disabled.
$encodeLabel whether the label should be HTML-encoded.
$icon the options for the optional icon. To specify an icon you can use the following parameters: php [ 'name' => 'name of the icon', // required 'position' => 'position of the icon', // optional, 'left' or 'right', defaults to 'left' 'options' => 'the HTML attributes for the img', // optional ]
$label the label on the button. If you do not want a label text to be rendered, set this options to "false".
$large whether the button shall be of larger size.
$tagName the tag used to render the button.
$type the type of button to be rendered. The following options are supported: - raised - floating - flat This property defaults to "raised". To set the type, use the corresponding TYPE_* constant of this class. If no type from this range is given, the button will be of the "raised" type.

Public Methods

Method Description
init ( ) Initializes the widget.
run ( ) : string Executes the widget.

Protected Methods

Method Description
renderIcon ( ) : string Renders an icon.

Method Details

init() public method

Initializes the widget.
public init ( )

renderIcon() protected method

Renders an icon.
See also: Icon::run
protected renderIcon ( ) : string
return string the rendered icon

run() public method

Executes the widget.
public run ( ) : string
return string the result of widget execution to be outputted.

Property Details

$disabled public_oe property

whether the button shall be disabled.
public $disabled

$encodeLabel public_oe property

whether the label should be HTML-encoded.
public $encodeLabel

$icon public_oe property

the options for the optional icon. To specify an icon you can use the following parameters: php [ 'name' => 'name of the icon', // required 'position' => 'position of the icon', // optional, 'left' or 'right', defaults to 'left' 'options' => 'the HTML attributes for the img', // optional ]
public $icon

$label public_oe property

the label on the button. If you do not want a label text to be rendered, set this options to "false".
public $label

$large public_oe property

whether the button shall be of larger size.
public $large

$tagName public_oe property

the tag used to render the button.
public $tagName

$type public_oe property

the type of button to be rendered. The following options are supported: - raised - floating - flat This property defaults to "raised". To set the type, use the corresponding TYPE_* constant of this class. If no type from this range is given, the button will be of the "raised" type.
public $type