本文整理汇总了PHP中Mage_Core_Block_Template::getCacheKey方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Block_Template::getCacheKey方法的具体用法?PHP Mage_Core_Block_Template::getCacheKey怎么用?PHP Mage_Core_Block_Template::getCacheKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Block_Template
的用法示例。
在下文中一共展示了Mage_Core_Block_Template::getCacheKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCacheKey
public function getCacheKey()
{
if (!$this->_isCacheActive()) {
parent::getCacheKey();
}
$this->_category = Mage::getSingleton('catalog/layer')->getCurrentCategory();
$total = $this->_getProductCollection()->getSize();
Mage::getSingleton('core/session')->setSizeValue('');
$toolbar = new Mage_Catalog_Block_Product_List_Toolbar();
$cacheKey = 'ProductList_' . $this->_category->getId() . '_' . $toolbar->getCurrentOrder() . '_' . $toolbar->getCurrentDirection() . '_' . $toolbar->getCurrentMode() . '_' . $toolbar->getCurrentPage() . '_' . $toolbar->getLimit() . '_' . $total . '_' . Mage::App()->getStore()->getCode();
foreach (Mage::app()->getRequest()->getParams() as $key => $value) {
if (is_array($value)) {
$value = implode('_', $value);
}
$realValue = '';
$valueArray = array();
$valueArray = explode('_', $value);
asort($valueArray);
$value = implode('_', $valueArray);
if (is_array($value)) {
foreach ($value as $k => $v) {
$realValue .= '_' . $v;
}
} else {
$realValue = $value;
}
if (!in_array(strtolower($key), array('utm_source', 'utm_content', 'utm_campaign', 'utm_medium', 'utm_term', 'gclid'))) {
$cacheKey .= "_" . $key . '-' . $realValue;
}
}
return $cacheKey;
}
示例2: getCacheKey
public function getCacheKey()
{
if (!$this->_isCacheActive()) {
parent::getCacheKey();
}
$cacheKey = 'SwatchList_' . $this->getPid() . '_' . Mage::App()->getStore()->getCode() . '_' . '';
return $cacheKey;
}