本文整理汇总了PHP中ImageHelper::getImage方法的典型用法代码示例。如果您正苦于以下问题:PHP ImageHelper::getImage方法的具体用法?PHP ImageHelper::getImage怎么用?PHP ImageHelper::getImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageHelper
的用法示例。
在下文中一共展示了ImageHelper::getImage方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
echo $item->name;
?>
" /></a><?php
}
?>
<?php
foreach ($images as $image) {
?>
<a href="<?php
echo $image->image;
?>
" title="<?php
echo $item->name . " " . $image->name;
?>
" rel="lightbox[roadtrip]"><img src="<?php
echo ImageHelper::getImage($image->image, 2);
?>
" title="<?php
echo $item->name . " " . $image->name;
?>
" alt="<?php
echo $item->name . " " . $image->name;
?>
" /></a>
<?php
}
?>
</div>
<?php
}
?>
示例2: elseif
?>
" alt="<?php
echo SiteHelper::getStringForTitle($tour->name . "," . $tour->category_id->name);
?>
" /></a>
<?php
} elseif (sizeof($listImages) > 0) {
?>
<a href="<?php
echo SiteHelper::createUrl("/tours/description") . "/" . $tour->slug;
?>
.html" title="<?php
echo SiteHelper::getStringForTitle($tour->name . "," . $tour->category_id->name);
?>
"><img src="<?php
echo ImageHelper::getImage($listImages[0]->image, 2);
?>
" alt="<?php
echo SiteHelper::getStringForTitle($tour->name . "," . $tour->category_id->name);
?>
" /></a>
<?php
}
?>
</div>
<a href="<?php
echo SiteHelper::createUrl("/tours/description") . "/" . $tour->slug;
?>
.html" title="<?php
echo SiteHelper::getStringForTitle($tour->category_id->name . "," . $tour->name);
?>
示例3: foreach
" alt="" /></div><?php
}
?>
<?php
if ($banner->image) {
$i = 2;
} else {
$i = 1;
}
foreach ($listImages as $LItem) {
?>
<div class="LII_<?php
echo $i;
?>
"><img src="<?php
echo ImageHelper::getImage($LItem->image, 3);
?>
" alt="" /></div>
<?php
$i++;
}
?>
</div>
<?php
}
?>
</td>
<td>
<a href="<?php
echo SiteHelper::createUrl("/user/firmBanners/description", array("id" => $banner->id, "fid" => $item->id));
?>
示例4: foreach
<?php
foreach ($items as $item) {
?>
<div class="listItems">
<?php
if ($item->image) {
?>
<div class="IImage"><a title="<?php
echo $item->name;
?>
" href="<?php
echo SiteHelper::createUrl("/news/description") . "/" . $item->slug;
?>
.html"><img src="<?php
echo ImageHelper::getImage($item->image, 2);
?>
" width="200" alt="<?php
echo $item->name;
?>
" /></a></a></div><?php
}
?>
<div class="LHeader">
<a title="<?php
echo $item->name;
?>
" href="<?php
echo SiteHelper::createUrl("/news/description") . "/" . $item->slug;
?>
.html"><?php
示例5: foreach
<div class="textAlignCenter"><?php
echo Yii::t("page", "Список пуст");
?>
</div><?php
}
?>
<?php
foreach ($listGallery as $gall) {
?>
<div class="LGItem">
<div>
<a href="<?php
echo $gall->image;
?>
" data-lightbox="roadtrip"><img src="<?php
echo ImageHelper::getImage($gall->image, 3);
?>
" /></a>
</div>
<input type="text" name="ITitle[<?php
echo $gall->id;
?>
]" value="<?php
echo $gall->name;
?>
" placeholder="<?php
echo Yii::t("page", "описание фото");
?>
" /><br/>
<a href="<?php
echo SiteHelper::createUrl("/user/" . Yii::app()->controller->getId() . "/description", array("id" => $item->id, "gall_id" => $gall->id, "action" => "delGallery"));
示例6: if
<div class="IBItem">
<div class="IBIImage">
<a href="<?php
echo SiteHelper::createUrl("/tours/description") . "/" . $tour->slug . ".html";
?>
" title=""><img src="<?php
echo ImageHelper::getImage($tour->image, 2);
?>
" alt="" /></a>
</div>
<?php
if ($tour->price > 0) {
?>
<p><?php
echo $tour->price;
?>
</p><?php
}
?>
<!--php if( $tour->col>0 ) : ?><div class="floatRight rightInfo">просмотров: <b><= $tour->col ></b></div><php endif; -->
<br/><a href="<?php
echo SiteHelper::createUrl("/tours/description") . "/" . $tour->slug;
?>
.html" title="<?php
echo $tour->name;
?>
"><?php
echo $tour->name;
?>
</a><br/>
<div class="LParams">
示例7: infoForm
static function infoForm($form)
{
$fields = $form->attributeLabels();
$relationList = $form->getRelationFields();
$relations = $form->relations();
$fieldType = $form->fieldType();
$requiredFields = $form->getRequiredAttributes();
$placeholder = $form->attributePlaceholder();
$cout = "";
$classTable = get_class($form);
foreach ($fields as $field => $key) {
if (!$form->{$field}) {
continue;
}
// Вытаскиваем тип поля
$fieldTypeValue = !empty($fieldType[$field]) ? $fieldTypeValue = $fieldType[$field] : "";
if (!in_array($field, $relationList) && (empty($fieldTypeValue) || empty($relations[$fieldTypeValue]))) {
// Подсказка к полю
if (!empty($placeholder[$field])) {
$fieldPlaceholder = $placeholder[$field];
} else {
$fieldPlaceholder = "";
}
if (!empty($fieldType[$field])) {
$input = "";
switch ($fieldType[$field]) {
case "url":
$input = '<a href="' . $form->{$field} . '" target="_blank">' . $form->{$field} . '</a>';
break;
case "email":
$input = '<div><a href="#" onclick="$(this.parentNode).load(\'' . SiteHelper::createUrl("site/getInfo", array("catalog" => "CatalogFirms", "id" => $form->id, "field" => "email")) . '\' ); return false;"> [ показать email ]</a></div>';
break;
case "email_open":
$input = $form->{$field};
break;
case "date":
$input = date("Y-m-d", $form->{$field});
break;
case "checkbox":
$input = "+";
break;
case "visual_textarea":
$input = $form->{$field};
break;
case "image":
$input = '<img src="../' . ImageHelper::getImage($form->{$field}, 2, $form) . '" width="100" /><br/>';
break;
case "file":
$input = '<a href="../' . $form->{$field} . '" target="_blank">' . $form->{$field} . '</a><br/>';
break;
default:
$input = $form->{$field};
}
} else {
$input = $form->{$field};
}
} else {
$input = "";
// проверяем нет ли привязки данного поля к сязи один ко многим
if (!empty($fieldTypeValue) && !empty($relations[$fieldTypeValue])) {
$relation = $relations[$fieldTypeValue];
} else {
$relation = $form->getRelationByField($field);
}
// привязка один к одному
$relationItems = CCModelHelper::getRelationItems($relation, $form);
$fieldName = $field;
if (sizeof($relationItems) > 0) {
if ($relation[0] == CCModel::HAS_MANY || $relation[0] == CCModel::MANY_MANY) {
/*
$relationModel = RelationParamsClass::CreateParams()
->setLeftId( $form->id )
->setLeftClass( $classTable )
->setRightClass( $relation[1] ) ;
$listValues = SiteHelper::getRelation( $relationModel );
$input .= '<div class="relationListItems">
<ul>';
foreach( $relationItems as $relationData )
{
if( !empty( $listValues[ $relationData->id ] ) )$checked = "checked=\"checked\"";
else $checked = "";
$input .= '<li><input type="checkbox" name="'.$classTable .'['.$relation[1].'][]" '.$checked.' value="'.$relationData->id.'" id="'.$field[1]."_".$relationData->id.'" /><label for="'.$field[1]."_".$relationData->id.'">'.$relationData->name.'</li>';
}
$input .= ' </ul>
</div>';
*/
} else {
$input = $form->{$fieldName}->name;
}
}
}
if (!empty($input)) {
$cout .= '<tr>
<th>' . $fields[$field] . ':</th>
<td>' . $input . '</td>
</tr>';
//.........这里部分代码省略.........
示例8: getAnimateImageBlock
static function getAnimateImageBlock($item, $link, $title = "", $count = 3)
{
if (!$item->image) {
$countImages = $count + 1;
} else {
$countImages = $count;
}
$count = 0;
if (defined("YII_SUBDOMAIN") && YII_SUBDOMAIN == "wap-") {
$countImages = 1;
}
$titleValue = !empty($title) ? $title : $item->name;
$listImages = ImageHelper::getImages($item, $countImages);
echo '<div class="listItemsImages">';
if (sizeof($listImages) > 0 || $item->image) {
?>
<?php
if ($item->image) {
?>
<div class="LII_1"><a href="<?php
echo $link;
?>
" title="<?php
echo $titleValue;
?>
"><img src="<?php
echo ImageHelper::getImage($item->image, 2);
?>
" alt="<?php
echo $titleValue;
?>
" /></a></div><?php
}
?>
<?php
if ($item->image) {
$i = 2;
} else {
$i = 1;
}
foreach ($listImages as $LItem) {
if ($i == 1) {
$imageSize = 2;
} else {
$imageSize = 3;
}
?>
<div class="LII_<?php
echo $i;
?>
">
<?php
if ($i == 1) {
?>
<a href="<?php
echo $link;
?>
" title="<?php
echo $titleValue;
?>
"><?php
}
?>
<img src="<?php
echo ImageHelper::getImage($LItem->image, $imageSize);
?>
" alt="<?php
echo $titleValue;
?>
" />
<?php
if ($i == 1) {
?>
</a><?php
}
?>
</div>
<?php
$i++;
}
?>
<?php
}
echo '</div>';
}
示例9:
?>
" title="<?php
echo $item["name"];
?>
"><?php
echo $item["name"];
?>
</a></div>
<div class="LTImag2"><a href="<?php
echo SiteHelper::createUrl("/tours/description") . "/" . $item["slug"] . ".html";
?>
" title="<?php
echo $item["name"];
?>
"><img src="<?php
echo ImageHelper::getImage($item["image2"], 2);
?>
" alt="<?php
echo $item["name"];
?>
" /></a></div>
<?php
if ($item["price"] > 0) {
?>
<div class="LTPrice2">от <b><?php
echo $item["price"];
?>
$</b> </div><?php
}
?>
</div>
示例10: actionShow
public function actionShow($idIn = 0, $locatIn = "", $return = FALSE)
{
$id = (int) Yii::app()->request->getParam("id", 0);
if ($id == 0 && $idIn > 0) {
$id = $idIn;
}
$locat = Yii::app()->request->getParam("location", "");
if (empty($locat) && !empty($locatIn)) {
$locat = $locatIn;
}
/*
График:
По странам ( сортировка по цене ) 31
По категориям ( сортировка по цене ) 30
По странам ( сортировка по просмотрам)
По категориям ( сортировка по просмотрам )
Определям кандидата по очереди сначала города потом категории
Выбираем по сортировке первую страну
Проверяем по очередньсти
Формируем письмо
Заголовок ( зависит от того по стране или категории + от сортировки )
указываем группу подписциков
указываем группу рассылоку
И полетели
*/
$cout = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Cache-Control" content="public"/>
<meta http-equiv="Cache-Control" content="max-age=86400, must-revalidate"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>';
$logTable = SubscribeTable::fetch($id);
if ($logTable->id > 0) {
if ($locat == "uzb" && $logTable->country_id->id == 1) {
return "";
}
$countryId = 0;
$categoryId = 0;
if ($logTable->country_id->id > 0) {
$countryId = $logTable->country_id->id;
$countryModel = CatalogCountry::fetch($countryId);
}
if ($logTable->category_id->id > 0) {
$categoryId = $logTable->category_id->id;
$categoryModel = CatalogToursCategory::fetch($categoryId);
}
if ($countryId > 0 || $categoryId > 0) {
$info = [];
if ($countryId > 0) {
$toursMinPrice = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid AND price>0 AND active=1")->setParams([":cid" => $countryModel->id])->setOrderBy("price")->setLimit(1)->setCache(0));
$tours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid AND id !=:id AND active=1")->setParams([":cid" => $countryModel->id, ":id" => $toursMinPrice[0]->id])->setLimit(7)->setOrderBy("rating DESC, price"));
$tours[] = $toursMinPrice[0];
$info = CatalogInfo::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid")->setParams([":cid" => $countryModel->id])->setLimit(4)->setOrderBy("id DESC"));
$subject = $countryModel->title . ", от " . $tours[sizeof($tours) - 1]->price . ($tours[sizeof($tours) - 1]->currency_id->id ? $tours[sizeof($tours) - 1]->currency_id->title : "\$");
} else {
$params = [":cid" => $categoryModel->id];
$condition = "category_id=:cid";
if ($locat == "uzb") {
echo $locat . "==uzb<br/>";
$params = array_merge($params, [":country" => 1]);
$condition .= " AND country_id!=:country";
} else {
$params = array_merge($params, [":country" => 1]);
$condition .= " AND country_id=:country";
}
echo $condition . "*";
$toursMinPrice = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($condition)->setParams($params)->setOrderBy("price")->setLimit(1)->setCache(0));
$tours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($condition . " AND id !=:id")->setParams(array_merge($params, [":id" => $toursMinPrice[0]->id]))->setLimit(7)->setOrderBy("rating DESC, price"));
$tours[] = $toursMinPrice[0];
//$info = CatalogInfo::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid")->setParams([":cid" => $categoryModel->id])->setLimit(4)->setOrderBy("id DESC"));
if ($tours[sizeof($tours) - 1]->price > 0) {
$subject = "Тур - " . $categoryModel->name . ", от " . $tours[sizeof($tours) - 1]->price . ($tours[sizeof($tours) - 1]->currency_id->id ? $tours[sizeof($tours) - 1]->currency_id->title : "\$");
} else {
$subject = "Тур - " . $categoryModel->name;
}
}
$message = "Предлагаем Вашему вниманию интересную подборку с нашего портала <a href=\"http://www.world-travel.uz\">World-Travel.uz</a>.<br/><br/><h1>" . $subject . "</h1><br/><table>";
$n = 0;
$reserveNum = 0;
$reserveList = [];
foreach ($tours as $tour) {
if ($tour->id == 0) {
continue;
}
$image = ImageHelper::getImages($tour, 1);
// Если картинки для тура нету, то берем её из резерва catalog_image_reserve
if (sizeof($image) == 0) {
if (sizeof($reserveList) == 0) {
$reserveList = CatalogImageReserve::findByAttributes(["country_id" => $tour->country_id->id]);
}
if (sizeof($reserveList) > 0) {
$new = new CatGallery();
if (!empty($reserveList[$reserveNum])) {
$new->image = $reserveList[$reserveNum]->image;
} else {
//.........这里部分代码省略.........
示例11: sizeof
echo sizeof($info) > 0 ? "col-lg-6 col-md-6 col-sm-12 col-xs-12" : "col-xs-12";
?>
" id="CGI01">
<h3>Галлерея</h3>
<div>
<?php
foreach ($gallery as $gal) {
?>
<div class="CGItem"><a href="<?php
echo $gal->image;
?>
" data-toggle="lightbox" data-gallery="multiimages" title="<?php
echo $item->title;
?>
"><img src="<?php
echo ImageHelper::getImage($gal->image, 2);
?>
" alt="<?php
echo $item->title;
?>
" /></a></div>
<?php
}
?>
<script type="text/javascript">
$(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
event.preventDefault();
$(this).ekkoLightbox();
});
</script>
</div>