本文整理匯總了PHP中Images::getThumbUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP Images::getThumbUrl方法的具體用法?PHP Images::getThumbUrl怎麽用?PHP Images::getThumbUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Images
的用法示例。
在下文中一共展示了Images::getThumbUrl方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getImgForSlider
public static function getImgForSlider()
{
$ownerActiveCond = '';
if (param('useUserads')) {
$ownerActiveCond = ' AND owner_active = ' . Apartment::STATUS_ACTIVE . ' ';
}
$sql = " SELECT i.id, i.id_object, i.file_name, i.file_name_modified, i.is_main, a.title_" . Yii::app()->language . " AS title\n\t\t\t\t FROM {{images}} i\n\t\t\t\t INNER JOIN {{apartment}} a ON a.id = i.id_object\n\t\t\t\t INNER JOIN {{apartment_paid}} ap ON ap.apartment_id = i.id_object\n\t\t\t\t WHERE ap.paid_id = :paid_id AND ap.status = 1 AND a.active=" . Apartment::STATUS_ACTIVE . " {$ownerActiveCond} AND i.is_main=1 GROUP BY ap.apartment_id";
$images = Yii::app()->db->createCommand($sql)->queryAll(true, array(':paid_id' => PaidServices::ID_ADD_IN_SLIDER));
$imgs = array();
if ($images) {
foreach ($images as $image) {
$imgs[$image['id_object']]['url'] = Apartment::getUrlById($image['id_object']);
$imgs[$image['id_object']]['title'] = $image['title'];
$imgs[$image['id_object']]['src'] = $class = Yii::app()->theme->name != 'classic' ? Images::getThumbUrl($image, 663, 380) : Images::getThumbUrl($image, param('slider_img_width', 500), param('slider_img_height', 280));
}
}
return $imgs;
}
示例2: foreach
if ($this->images) {
?>
<div class="images-area">
<?php
foreach ($this->images as $image) {
if ($this->withMain && $image['is_main'] || !$this->withMain && !$image['is_main'] || !$image['is_main']) {
?>
<div class="image-item" id="image_<?php
echo $image['id'];
?>
">
<div class="image-drag-area"></div>
<div class="image-link-item">
<?php
$imgTag = CHtml::image(Images::getThumbUrl($image, 150, 100), Images::getAlt($image));
echo CHtml::link($imgTag, Images::getFullSizeUrl($image), array('class' => 'fancy', 'rel' => 'gallery', 'title' => Images::getAlt($image)));
?>
<br/>
<span class="setAsMain" link-id="<?php
echo $image['id'];
?>
">
<?php
if ($image['is_main']) {
echo tc('Main photo');
} else {
echo '<a class="setAsMainLink" href="#">' . tc('Set as main photo') . '</a>';
}
?>
</span><br/>
示例3: foreach
<?php
$count = 0;
if ($this->images) {
?>
<ul class="thumbnails">
<?php
foreach ($this->images as $image) {
?>
<li>
<?php
/*$imgTag = CHtml::image(Images::getThumbUrl($image, 640, 400), Images::getAlt($image));
echo CHtml::link($imgTag, Images::getThumbUrl($image, 640, 400),
array(
'title' => Images::getAlt($image),
)
);*/
$imgTag = CHtml::image(Images::getThumbUrl($image, 100, 100), Images::getAlt($image), array());
echo CHtml::link($imgTag, '', array('title' => Images::getAlt($image), 'class' => 'thumbnail', 'id' => 'carousel-selector-' . $count));
$count++;
?>
</li>
<?php
}
?>
</ul>
<?php
}