本文整理匯總了PHP中Images::GetLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP Images::GetLink方法的具體用法?PHP Images::GetLink怎麽用?PHP Images::GetLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Images
的用法示例。
在下文中一共展示了Images::GetLink方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __get
public function __get($strName)
{
switch ($strName) {
case 'Name':
return $this->Title;
case 'IsMaster':
return $this->IsMaster();
case 'IsChild':
return $this->IsChild();
case 'IsIndependent':
return $this->IsIndependent();
case 'Slug':
return $this->GetSlug();
case 'Code':
if ($this->IsChild()) {
if ($prod = $this->GetMaster()) {
return $prod->code;
}
}
return $this->code;
case 'FkProductMaster':
return $this->GetMaster();
case 'InventoryDisplay':
return $this->InventoryDisplay();
case 'Family':
if (isset($this->family)) {
return $this->family->family;
} else {
return '';
}
case 'Class':
if (isset($this->class)) {
return $this->class->class_name;
} else {
return '';
}
case 'Url':
case 'Link':
return $this->getUrl();
case 'SEOName':
return $this->GetSEOName();
case 'AbsoluteUrl':
return $this->GetAbsoluteUrl();
case 'AddToCartImage':
return $this->GetImageLink(ImagesType::addtocartmodal);
case 'ListingImage':
return $this->GetImageLink(ImagesType::listing);
case 'ListingImageAbsolute':
return $this->GetImageLink(ImagesType::listing, true);
case 'MiniImage':
return $this->GetImageLink(ImagesType::mini);
case 'MiniImageAbsolute':
return $this->GetImageLink(ImagesType::mini, true);
case 'MiniImageTag':
return CHtml::image(Images::GetLink($this->image_id, ImagesType::mini));
case 'PreviewImage':
return $this->GetImageLink(ImagesType::preview);
case 'PreviewImageAbsolute':
return $this->GetImageLink(ImagesType::preview, true);
case 'PreviewImageTag':
return CHtml::image(Images::GetLink($this->image_id, ImagesType::preview));
case 'SliderImage':
return $this->GetImageLink(ImagesType::slider);
case 'SliderImageAbsolute':
return $this->GetImageLink(ImagesType::slider, true);
case 'SliderImageTag':
return CHtml::image(Images::GetLink($this->image_id, ImagesType::slider));
case 'CategoryImage':
return $this->GetImageLink(ImagesType::category);
case 'CategoryImageAbsolute':
return $this->GetImageLink(ImagesType::category, true);
case 'CategoryImageTag':
return CHtml::image(Images::GetLink($this->image_id, ImagesType::category));
case 'PDetailImage':
return $this->GetImageLink(ImagesType::pdetail);
case 'PDetailImageAbsolute':
return $this->GetImageLink(ImagesType::pdetail, true);
case 'PDetailImageTag':
return CHtml::image(Images::GetLink($this->image_id, ImagesType::pdetail));
case 'SmallImage':
return $this->GetImageLink(ImagesType::small);
case 'SmallImageAbsolute':
return $this->GetImageLink(ImagesType::small, true);
case 'SmallImageTag':
return CHtml::image(Images::GetLink($this->image_id, ImagesType::small));
case 'Image':
return $this->GetImageLink(ImagesType::normal);
case 'ImageAbsolute':
return $this->GetImageLink(ImagesType::normal, true);
case 'ImageTag':
return CHtml::image(Images::GetLink($this->image_id, ImagesType::normal));
case 'OriginalCode':
return $this->code;
case 'SizeLabel':
return _xls_get_conf('PRODUCT_SIZE_LABEL', _sp('Size'));
case 'ColorLabel':
return _xls_get_conf('PRODUCT_COLOR_LABEL', _sp('Color'));
case 'PageTitle':
return _xls_truncate($this->GetPageMeta('SEO_PRODUCT_TITLE'), 70);
case 'PageDescription':
//.........這裏部分代碼省略.........
示例2: GetImageLink
protected function GetImageLink($type)
{
return Images::GetLink($this->image_id, $type);
}
示例3: actionGetmatrixproduct
/**
* Ajax responder, when choosing a color from the dropdown, get product details to update page
*/
public function actionGetmatrixproduct()
{
if (Yii::app()->request->isAjaxRequest === false) {
return;
}
$id = Yii::app()->getRequest()->getParam('id');
$strSize = Yii::app()->getRequest()->getParam('product_size');
$strColor = Yii::app()->getRequest()->getParam('product_color');
$objProduct = Product::LoadChildProduct($id, $strSize, $strColor);
if ($objProduct instanceof Product) {
$arrReturn['status'] = 'success';
$arrReturn['id'] = $objProduct->id;
$arrReturn['FormattedPrice'] = $objProduct->getMarkedUpPrice();
$arrReturn['FormattedRegularPrice'] = $objProduct->SlashedPrice;
$arrReturn['image_id'] = CHtml::image(Images::GetLink($objProduct->image_id, ImagesType::pdetail));
$arrReturn['code'] = $objProduct->code;
$arrReturn['title'] = $objProduct->Title;
$arrReturn['InventoryDisplay'] = $objProduct->InventoryDisplay;
$arrReturn['FormattedSavingsAmount'] = $objProduct->getFormattedSavingsAmount();
$arrReturn['FormattedSavingsPercentage'] = $objProduct->getFormattedSavingsPercentage();
if ($objProduct->WebLongDescription) {
$arrReturn['description_long'] = $objProduct->WebLongDescription;
} else {
$arrReturn['description_long'] = $objProduct->parent0->WebLongDescription;
}
if ($objProduct->description_short) {
$arrReturn['description_short'] = $objProduct->WebShortDescription;
} else {
$arrReturn['description_short'] = $objProduct->parent0->WebShortDescription;
}
Yii::app()->clientscript->scriptMap['jquery.js'] = false;
$arrReturn['photos'] = $this->renderPartial('/product/_photos', array('model' => $objProduct), true, false);
} else {
// options are missing so return the master product
$objProduct = Product::model()->findByPk($id);
$arrReturn['FormattedPrice'] = $objProduct->getFormattedSlashedPrice();
$arrReturn['FormattedRegularPrice'] = $objProduct->SlashedPrice;
$arrReturn['FormattedSavingsAmount'] = $objProduct->getFormattedSavingsAmount();
$arrReturn['FormattedSavingsPercentage'] = $objProduct->getFormattedSavingsPercentage();
$arrReturn['code'] = $objProduct->code;
$arrReturn['title'] = $objProduct->Title;
$arrReturn['InventoryDisplay'] = $objProduct->InventoryDisplay;
if ($objProduct->WebLongDescription) {
$arrReturn['description_long'] = $objProduct->WebLongDescription;
}
if ($objProduct->description_short) {
$arrReturn['description_short'] = $objProduct->WebShortDescription;
}
$arrReturn['photos'] = $this->renderPartial('/product/_photos', array('model' => $objProduct), true, false);
}
echo json_encode($arrReturn);
}
示例4: getUploadPhotoFeed
public function getUploadPhotoFeed($objProduct)
{
$url = Images::GetLink($objProduct->image_id, ImagesType::normal, true);
//If our URL is schema-less, prepend schema so Amazon is happy
if (substr($url, 0, 2) == '//') {
$url = "http:" . $url;
}
$strFeed = '<?xml version="1.0" encoding="utf-8" ?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amznenvelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>' . $this->MerchantID . '</MerchantIdentifier>
</Header>
<MessageType>ProductImage</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<ProductImage>
<SKU>' . $objProduct->code . '</SKU>
<ImageType>Main</ImageType>
<ImageLocation>' . $url . '</ImageLocation>
</ProductImage>
</Message>
</AmazonEnvelope>';
Yii::log("Created photo feed " . $strFeed, 'info', 'application.' . __CLASS__ . "." . __FUNCTION__);
return $strFeed;
}