Yii2 WebUI Popover
This widget is a Yii 2 wrapper of WebUI-Popover plugin., (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist kit-tools/yii2-webui-popover "*"
or add, (*4)
"kit-tools/yii2-webui-popover": "*"
to the require section of your composer.json
file., (*5)
Usage
Once the extension is installed, simply use it in your code by :, (*6)
use kittools\webuipopover\WebUIPopover;
echo WebUIPopover::widget([
'label' => 'Button popup',
'tagName' => 'button',
'body' => 'Content popup'
]);
The following example will show the content enclosed between the begin() and end() calls within the popover box:, (*7)
WebUIPopover::begin([
'label' => 'Button popup',
'tagName' => 'button',
'tagOptions' => [
'class' => 'btn btn-success',
],
'pluginOptions' => [
'placement' => 'right',
'animation' => 'pop',
'title' => 'Popover title',
'onShow' => 'function($element) {console.log($element);}'
],
]);
echo 'Content popup';
WebUIPopover::end();
Checkout the documentation for further information., (*8)