2017 © Pedro Peláez
 

yii2-extension yii2-disposable-tooltip

Yii2: Widget creates disposable tooltips

image

pavlinter/yii2-disposable-tooltip

Yii2: Widget creates disposable tooltips

  • Saturday, August 1, 2015
  • by pavlinter
  • Repository
  • 1 Watchers
  • 0 Stars
  • 55 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii2 Disposable Tooltip

Installation

The preferred way to install this extension is through composer., (*1)

Either run, (*2)

php composer.phar require --prefer-dist pavlinter/yii2-disposable-tooltip "dev-master"

or add, (*3)

"pavlinter/yii2-disposable-tooltip": "dev-master"

to the require section of your composer.json file., (*4)

Configuration

  • Before configure: yii2-dot-translation
  • Run migration file php 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(); ?>

The Versions

01/08 2015

dev-master

9999999-dev

Yii2: Widget creates disposable tooltips

  Sources   Download

BSD 3-Clause

The Requires

 

by Pavels Radajevs

yii2 disposable tooltip