PHP Class macgyer\yii2materializecss\widgets\FixedActionButton

Imagine you have an calendar app with a single "create" button. Your user shall be able to create calendar entries and contacts. Those actions require a dedicated button. For UI reasons you can group both (or as much buttons as you like) single buttons by a "parent" button element. The child buttons can be displayed by hover or click.
See also: http://materializecss.com/buttons.html#floating
Author: Christoph Erdmann ([email protected])
Inheritance: extends macgyer\yii2materializecss\lib\BaseWidget
Mostrar archivo Open project: macgyer/yii2-materializecss

Public Properties

Property Type Description
$buttonEncodeLabel whether the label should be HTML-encoded.
$buttonIcon the options for the optional icon. The icon will be rendered by [[Icon|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 ]
$buttonLabel the label on the button.
$buttonOptions the HTML attributes for the visible button.
$buttonTagName the tag used to render the button. Should be "a" for correct functionality of [[clickToToggle]] FAB.
$clickToToggle whether the button items are only visible after click.
$encodeLabels whether the labels for the items should be HTML-encoded.
$horizontal whether to display a horizontal FAB.
$items list of button items in the fixed action button. Each element can be either an HTML string or an array representing a single item with the following specification: - label: string, required, the label of the item link - url: string|array, optional, the url of the item link. This will be processed by yii\helpers\Url::to()-detail). - visible: boolean, optional, whether this menu item is visible. Defaults to true. - linkOptions: array, optional, the HTML attributes of the item link. - options: array, optional, the HTML attributes of the item.
$itemsContainerOptions the HTML attributes for the container around the button items.
$options the HTML attributes for the widget container tag.

Public Methods

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

Protected Methods

Method Description
renderItems ( ) : string Renders a list representing the single button items.

Method Details

init() public method

Initializes the widget.
public init ( )

renderItems() protected method

Renders a list representing the single button items.
protected renderItems ( ) : string
return string

run() public method

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

Property Details

$buttonEncodeLabel public_oe property

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

$buttonIcon public_oe property

the options for the optional icon. The icon will be rendered by [[Icon|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 $buttonIcon

$buttonLabel public_oe property

the label on the button.
public $buttonLabel

$buttonOptions public_oe property

the HTML attributes for the visible button.
See also: [yii\helpers\BaseHtml::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $buttonOptions

$buttonTagName public_oe property

the tag used to render the button. Should be "a" for correct functionality of [[clickToToggle]] FAB.
public $buttonTagName

$clickToToggle public_oe property

whether the button items are only visible after click.
public $clickToToggle

$encodeLabels public_oe property

whether the labels for the items should be HTML-encoded.
public $encodeLabels

$horizontal public_oe property

whether to display a horizontal FAB.
public $horizontal

$items public_oe property

list of button items in the fixed action button. Each element can be either an HTML string or an array representing a single item with the following specification: - label: string, required, the label of the item link - url: string|array, optional, the url of the item link. This will be processed by yii\helpers\Url::to()-detail). - visible: boolean, optional, whether this menu item is visible. Defaults to true. - linkOptions: array, optional, the HTML attributes of the item link. - options: array, optional, the HTML attributes of the item.
public $items

$itemsContainerOptions public_oe property

the HTML attributes for the container around the button items.
See also: [yii\helpers\BaseHtml::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $itemsContainerOptions

$options public_oe property

the HTML attributes for the widget container tag.
See also: [yii\helpers\BaseHtml::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $options