kit-tools/yii2-webui-popover

WebUI Popover widget for Yii2.

Installs: 2 375

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 1

Type:yii2-extension

dev-master 2016-03-09 16:34 UTC

This package is auto-updated.

Last update: 2024-04-26 20:22:35 UTC


README

This widget is a Yii 2 wrapper of WebUI-Popover plugin.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist kit-tools/yii2-webui-popover "*"

or add

"kit-tools/yii2-webui-popover": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

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:

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.