PHP code example of jacerider / neo_tooltip
1. Go to this page and download the library: Download jacerider/neo_tooltip library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jacerider / neo_tooltip example snippets
// Link element.
$build['link'] = [
'#type' => 'link',
'#title' => $this->t('Tooltip trigger'),
'#url' => Url::fromRoute('<front>'),
];
$content = 'Tooltip content';
$tooltip = new Drupal\neo_tooltip\Tooltip($content);
$tooltip
->setAnimationToShiftAway()
->setPlacementToBottomStart()
->setArrow(FALSE)
->setTrigger('focusin');
$tooltip->applyTo($build['link']);
// Markup element.
$build['markup'] = [
'#markup' => '<p>' . $this->t('This is a markup tooltip.') . '</p>',
];
$tooltip = new Tooltip('Tooltip content');
$tooltip->applyTo($build['markup']);