Answer the question
In order to leave comments, you need to log in
How to style Thumb on an image?
the news displays thumb pictures through
<?php if($entries->image):?>
<?php $src = $entries->image->getSmallThumbLink(); ?>
<?php if($src) : ?>
<?php
$tagAlt = CHtml::encode($entries->getStrByLang('title'));
if (issetModule('seo') && isset($entries->image->image_seo) && $entries->image->image_seo->getStrByLang('alt')) {
$tagAlt = CHtml::encode($entries->image->image_seo->getStrByLang('alt'));
}
?>
<?php echo CHtml::link(CHtml::image($src, $tagAlt),array('style'=>'border-radius: 50%;')); ?>
class EntriesImage extends ParentModel {
public $imageInstance = null;
public $path = 'webroot.uploads.entries';
const SMALL_THUMB_WIDTH = 211;
const SMALL_THUMB_HEIGHT = 180;
Answer the question
In order to leave comments, you need to log in
htmlOptions is the third option in CHtml::image
public static string image(string $src, string $alt='', array $htmlOptions=array ( ))
For example when using array('class' => 'my-class' , 'target' => '_blank') as htmlOptions it will result in the html attributes rendered like this: class="my-class" target="_blank".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question