Skip to content
Ronald Baltus edited this page Jun 13, 2013 · 1 revision

The SxBootstap tooltip view helper shows a tooltip made with the twitter bootstrap. The following syntax builds the tooltip. It is possible to chain types.

<?php
// available parameters: string, string
echo $this->sxbTooltip('Hover over me!', 'I will appear!', 'optional href for click');
?>
<?php
// Chained example
echo $this->sxbTooltip()->setTitle('Hover over me!')->setContent('I will appear!');
?>

Supplying options

See options section at Bootstrap Tooltips

<?php
echo $this->sxbTooltip()->setOptions(array(
    'title' => 'Hover over me!',
    'selector' => 'a.tooltip',
    'trigger' => 'hover'
));
?>

Available chain methods

<?php
echo $this->sxbTooltip()
    ->setTitle('string'),
    ->setDefaultTitle('string'),
    ->setSelector('string')
    ->setPlacement('string')
    ->setTrigger('string')
    ->setHref('string')
    ->setOptions(array())
    ->setOption('string', 'string')
    ->render();
?>

Javascript

The tooltips are not automatically registered with the Bootstrap jQuery plugin.

$('a[rel=tooltip]').tooltip();

Clone this wiki locally