public function tooltip()
{
return _class('html')->tooltip('This is custom text to be displayed inside tooltip, also you can use tip short names, editable from admin panel');
}
public function tooltip($text = '', $extra = [])
{
if ($this->_is_bs5) {
return $this->_bs5()->tooltip($text, $extra);
}
if (is_array($text)) {
$extra = (array) $extra + $text;
$text = '';
}
if ( ! is_array($extra)) {
$extra = [];
}
$extra['text'] = ($extra['text'] ?? null) ?: $text;
$extra['icon'] = ($extra['icon'] ?? null) ?: 'icon icon-info-sign fa fa-question-circle';
$extra['href'] = ($extra['href'] ?? null) ?: '#';
$extra['class'] = (($extra['class'] ?? null) ?: 'yf_tip') . (($extra['class_add'] ?? null) ? ' ' . ($extra['class_add'] ?? null) : '');
$extra['data-content'] = ($extra['data-content'] ?? null) ?: _prepare_html(($extra['text'] ?? null));
$extra['data-toggle'] = ($extra['data-toggle'] ?? null) ?: 'popover';
$extra['data-container'] = ($extra['data-container'] ?? null) ?: 'body';
$extra['data-html'] = ($extra['data-html'] ?? null) ?: 'true';
return ( ! ($extra['no_nbsp'] ?? null) ? ' ' : '') . '<span' . _attrs($extra, ['id', 'class', 'style']) . '><i class="' . ($extra['icon'] ?? null) . '"></i></span>';
}