TbHtml::abbr PHP Method

abbr() public static method

Generates an abbreviation with a help text.
public static abbr ( string $text, string $word, array $htmlOptions = [] ) : string
$text string the abbreviation.
$word string the word the abbreviation is for.
$htmlOptions array additional HTML attributes.
return string the generated abbreviation.
    public static function abbr($text, $word, $htmlOptions = array())
    {
        if (TbArray::popValue('small', $htmlOptions, false)) {
            self::addCssClass('initialism', $htmlOptions);
        }
        $htmlOptions['title'] = $word;
        return self::tag('abbr', $htmlOptions, $text);
    }

Usage Example

Example #1
0
?>
    </div>
    <pre class="prettyprint linenums">
&lt;?php echo TbHtml::muted('Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.'); ?>
&lt;?php echo TbHtml::em('Etiam porta sem malesuada magna mollis euismod.', array('color' => TbHtml::TEXT_COLOR_WARNING)); ?>
&lt;?php echo TbHtml::em('Donec ullamcorper nulla non metus auctor fringilla.', array('color' => TbHtml::TEXT_COLOR_ERROR)); ?>
&lt;?php echo TbHtml::em('Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.', array('color' => TbHtml::TEXT_COLOR_INFO)); ?>
&lt;?php echo TbHtml::em('Duis mollis, est non commodo luctus, nisi erat porttitor ligula.', array('color' => TbHtml::TEXT_COLOR_SUCCESS)); ?></pre>

    <hr class="bs-docs-separator">

    <h2>Abbrivations</h2>

    <div class="bs-docs-example">
        An abbreviation of the word attribute is <?php 
echo TbHtml::abbr('attr', 'attribute');
?>
.
    </div>
    <pre class="prettyprint linenums">
An abbreviation of the word attribute is &lt;?php echo TbHtml::abbr('attr', 'attribute'); ?>.</pre>

    <h3>Small</h3>

    <div class="bs-docs-example">
        <?php 
echo TbHtml::smallAbbr('HTML', 'HyperText Markup Language');
?>
 is the best thing since sliced bread.
    </div>
    <pre class="prettyprint linenums">
All Usage Examples Of TbHtml::abbr
TbHtml