TbHtml::image PHP Method

image() public static method

Generates an image tag.
public static image ( string $src, string $alt = '', array $htmlOptions = [] ) : string
$src string the image URL.
$alt string the alternative text display.
$htmlOptions array additional HTML attributes.
return string the generated image tag.
    public static function image($src, $alt = '', $htmlOptions = array())
    {
        $type = TbArray::popValue('type', $htmlOptions);
        if (!empty($type)) {
            self::addCssClass('img-' . $type, $htmlOptions);
        }
        if (TbArray::popValue('responsive', $htmlOptions, false)) {
            self::addCssClass('img-responsive', $htmlOptions);
        }
        return parent::image($src, $alt, $htmlOptions);
    }

Usage Example

   padding: 0 !important;
   margin: 0 !important;
   padding-bottom: 0;
}
</style>
<div class="container"> 
    <div class="row">
        <div class="col-xs-5">
            <div class="panel panel-default">
                <div class="panel-body">
                    <p>
                        <?php 
if (Yii::app()->settings->get('receipt', 'printcompanyLogo') == '1') {
    ?>
                            <?php 
    echo TbHtml::image(Yii::app()->baseUrl . '/images/logo.png', 'Company\'s logo', array('width' => '100'));
    ?>
 <br>
                        <?php 
}
?>
                    </p>
                </div>
            </div>
        </div>
        <div class="col-xs-6 col-xs-offset-1 text-right">
            <div class="panel panel-default">
                    <p>
                        <?php 
if (Yii::app()->settings->get('receipt', 'printcompanyName') == '1') {
    ?>
All Usage Examples Of TbHtml::image
TbHtml