PHP Class macgyer\yii2materializecss\widgets\Chip

An Usual use case is the displaying of tags or contact information.
See also: http://materializecss.com/chips.html
Author: Christoph Erdmann ([email protected])
Inheritance: extends macgyer\yii2materializecss\lib\BaseWidget
Show file Open project: macgyer/yii2-materializecss

Public Properties

Property Type Description
$content the content of the chip besides the optional image and/or [[Icon|Icon]].
$encodeContent whether to encode the content. If this property is set to "false" the content will be rendered without the encoding of HTML special characters.
$icon the options for the optional [[Icon|Icon]]. If there is an icon present in the chip element, Materialize will treat it as a close (i. e. remove) trigger. To specify an [[Icon|Icon]] you can use the following parameters: php [ 'name' => 'name of the icon', // optional, defaults to 'close' 'position' => 'position of the icon', // optional, 'left' or 'right', defaults to 'left' 'options' => 'the HTML attributes for the icon', // optional ]
$imageOptions the HTML attributes for the img tag. Specifiy at least the src key representing the source of the image.
$options the HTML attributes for the widget container tag. The following special options are recognized: - tag: string, defaults to "div", the name of the container tag.
$renderIcon whether to render the [[Icon|Icon]] inside the chip.

Public Methods

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

Method Details

init() public method

Initializes the widget.
public init ( )

run() public method

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

Property Details

$content public property

the content of the chip besides the optional image and/or [[Icon|Icon]].
public $content

$encodeContent public property

whether to encode the content. If this property is set to "false" the content will be rendered without the encoding of HTML special characters.
public $encodeContent

$icon public property

the options for the optional [[Icon|Icon]]. If there is an icon present in the chip element, Materialize will treat it as a close (i. e. remove) trigger. To specify an [[Icon|Icon]] you can use the following parameters: php [ 'name' => 'name of the icon', // optional, defaults to 'close' 'position' => 'position of the icon', // optional, 'left' or 'right', defaults to 'left' 'options' => 'the HTML attributes for the icon', // optional ]
public $icon

$imageOptions public property

the HTML attributes for the img tag. Specifiy at least the src key representing the source of the image.
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 $imageOptions

$options public property

the HTML attributes for the widget container tag. The following special options are recognized: - tag: string, defaults to "div", the name of the 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

$renderIcon public property

whether to render the [[Icon|Icon]] inside the chip.
public $renderIcon