pavlinter / yii2-disposable-tooltip
Yii2: Widget creates disposable tooltips
Installs: 83
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 1
Type:yii2-extension
Requires
- php: >=5.4.0
- pavlinter/yii2-dot-translation: 1.*
- yiisoft/yii2: *
- yiisoft/yii2-bootstrap: *
This package is not auto-updated.
Last update: 2024-12-21 16:51:57 UTC
README
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist pavlinter/yii2-disposable-tooltip "dev-master"
or add
"pavlinter/yii2-disposable-tooltip": "dev-master"
to the require section of your composer.json
file.
Configuration
- Before configure: yii2-dot-translation
- Run migration file
yii migrate --migrationPath=@vendor/pavlinter/yii2-disposable-tooltip/tooltip/migrations
- Update config
'modules' => [ .... 'distooltip' => [ 'class' => 'pavlinter\tooltip\Module', //default 'cookieName' => 'user_tooltip', 'storage' => \pavlinter\tooltip\Hint::TYPE_AUTO, 'userTooltipTable' => '{{%user_tooltip}}', 'sourceMessageTable' => '{{%source_message}}', ], .... ],
Usage
<?php Hint::begin([ 'category' => 'app/hints', 'message' => 'Hi! I am {tip}.', 'params' => ['tip' => 'tooltip'], //default 'moduleId' => 'distooltip', 'tag' => 'span', 'options' => [], 'clientOptions' => [], 'clientEvents' => [ 'dhint.ajaxBeforeSend' => 'function($cont,id){ console.log("ajaxBeforeSend");}', 'dhint.ajaxSuccess' => 'function($cont,id,data){ console.log("ajaxSuccess");}', 'dhint.ajaxComplete' => 'function($cont,id,jqXHR,textStatus){ console.log("ajaxComplete");}', 'dhint.ajaxError' => 'function($cont,id,jqXHR,textStatus,message){ console.log("ajaxError");}', ], 'closeButton' => [ 'class' => 'glyphicon glyphicon-remove pull-right', ], 'template' => '<div class="popover"><div class="arrow"></div><h3 class="popover-title clearfix"></h3><div class="popover-content"></div></div>', 'title' => '', ]);?> <div class="content">Your content</div> <?php Hint::end(); ?>