echo $this->getLayout()->createBlock('mpanel/products')
->setProductsCount($this->getProductsCount())
->setCountPerRow($this->getCountPerRow())
->setLoadMore($this->getLoadMore())
->setTemplate('mgs/mpanel/products/grid/featured_products.phtml')
->toHtml();
How I can disable cache for the above block call.
2 Answers 2
Try below code
setCacheLifeTime to null and then your block will not be cache
echo $this->getLayout()->createBlock('mpanel/products')
->setCacheLifetime('null') //setCacheLifeTime to 0
->setProductsCount($this->getProductsCount())
->setCountPerRow($this->getCountPerRow())
->setLoadMore($this->getLoadMore())
->setTemplate('mgs/mpanel/products/grid/featured_products.phtml')
->toHtml();
answered Jan 31, 2018 at 8:45
-
It's not working.Karna Saradar– Karna Saradar2018年01月31日 09:18:09 +00:00Commented Jan 31, 2018 at 9:18
-
1@KarnaSaradar try with null2018年01月31日 09:40:30 +00:00Commented Jan 31, 2018 at 9:40
You can use the below code.
<reference name="Your_Block">
<action method="setCacheLifetime"><s>null</s></action>
</reference>
default