PHP Класс macgyer\yii2materializecss\widgets\Modal

The following example will show the content enclosed between the \yii\base\Widget::begin()-detail) and \yii\base\Widget::end()-detail) calls within the modal window: php Modal::begin([ 'closeButton' => [ 'label' => 'Close modal', 'tag' => 'span' ], 'toggleButton' => [ 'label' => 'Open modal' ], 'modalType' => Modal::TYPE_BOTTOM_SHEET, ]); echo 'Say hello...'; Modal::end();
См. также: http://materializecss.com/modals.html
Автор: Christoph Erdmann ([email protected])
Наследование: extends macgyer\yii2materializecss\lib\BaseWidget
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$closeButton the options for rendering the close button tag. The close button is displayed in the header of the modal window. Clicking on the button will hide the modal window. If this is false, no close button will be rendered. The following special options are supported: - tag: string, the tag name of the button. Defaults to 'button'. - label: string, the label of the button. Defaults to '×'. The rest of the options will be rendered as the HTML attributes of the button tag. Please refer to the Modal plugin help for the supported HTML attributes.
$closeButtonPosition the position of the close button. The following options are supported: - beforeContent, right before the content, inside the container ".modal-content" - afterContent, right after the content, inside the container ".modal-content" - beforeFooter, right before the footer content, inside the container ".modal-footer" - afterFooter, right before the footer content, inside the container ".modal-footer" - precedeContainer, directly before the container ".modal-content" opens - succeedContainer, directly after the container ".modal-content" closes Defaults to "beforeContent".
$footer the content of the footer.
$footerOptions the optional HTML attributes for the footer container.
$modalType the different modal types. The following options are supported - lean (default) - fixedFooter - bottomSheet
$options the HTML attributes for the widget container tag. These special options are recognized: - tag: string, defaults to "div", the name of the container tag.
$toggleButton the options for rendering the toggle button tag. The toggle button is used to toggle the visibility of the modal window. If this property is false, no toggle button will be rendered. The following special options are supported: - tag: string, the tag name of the button. Defaults to 'button'. - label: string, the label of the button. Defaults to 'Show'. The rest of the options will be rendered as the HTML attributes of the button tag. Please refer to the Modal plugin help for the supported HTML attributes.

Открытые методы

Метод Описание
init ( ) Initializes the widget.
run ( ) : string Executes the widget.

Защищенные методы

Метод Описание
initDefaults ( ) Set inital default options.
renderCloseButton ( ) : null | string Renders the close button.
renderFooter ( ) : string Renders the Modal footer.
renderToggleButton ( ) : null | string Renders the Modal's toggle button.

Описание методов

init() публичный Метод

Initializes the widget.
public init ( )

initDefaults() защищенный Метод

Set inital default options.
protected initDefaults ( )

renderCloseButton() защищенный Метод

Renders the close button.
См. также: closeButton
protected renderCloseButton ( ) : null | string
Результат null | string the rendered result.

renderFooter() защищенный Метод

Renders the Modal footer.
protected renderFooter ( ) : string
Результат string the rendered markup of the footer.

renderToggleButton() защищенный Метод

Renders the Modal's toggle button.
См. также: toggleButton
protected renderToggleButton ( ) : null | string
Результат null | string the rendered result.

run() публичный Метод

Executes the widget.
public run ( ) : string
Результат string the result of widget execution to be outputted.

Описание свойств

$closeButton публичное свойство

the options for rendering the close button tag. The close button is displayed in the header of the modal window. Clicking on the button will hide the modal window. If this is false, no close button will be rendered. The following special options are supported: - tag: string, the tag name of the button. Defaults to 'button'. - label: string, the label of the button. Defaults to '×'. The rest of the options will be rendered as the HTML attributes of the button tag. Please refer to the Modal plugin help for the supported HTML attributes.
См. также: [\yii\helpers\Html::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $closeButton

$closeButtonPosition публичное свойство

the position of the close button. The following options are supported: - beforeContent, right before the content, inside the container ".modal-content" - afterContent, right after the content, inside the container ".modal-content" - beforeFooter, right before the footer content, inside the container ".modal-footer" - afterFooter, right before the footer content, inside the container ".modal-footer" - precedeContainer, directly before the container ".modal-content" opens - succeedContainer, directly after the container ".modal-content" closes Defaults to "beforeContent".
public $closeButtonPosition

$footerOptions публичное свойство

the optional HTML attributes for the footer container.
См. также: [\yii\helpers\Html::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $footerOptions

$modalType публичное свойство

the different modal types. The following options are supported - lean (default) - fixedFooter - bottomSheet
См. также: http://materializecss.com/modals.html
public $modalType

$options публичное свойство

the HTML attributes for the widget container tag. These special options are recognized: - tag: string, defaults to "div", the name of the container tag.
См. также: [\yii\helpers\Html::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $options

$toggleButton публичное свойство

the options for rendering the toggle button tag. The toggle button is used to toggle the visibility of the modal window. If this property is false, no toggle button will be rendered. The following special options are supported: - tag: string, the tag name of the button. Defaults to 'button'. - label: string, the label of the button. Defaults to 'Show'. The rest of the options will be rendered as the HTML attributes of the button tag. Please refer to the Modal plugin help for the supported HTML attributes.
См. также: [\yii\helpers\Html::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $toggleButton