我的CMS中有这样的标签:
{{block type="catalog/product_new" column_count="3" blerg="moo" _productsCount="10" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}注意变量blerg=moo.
然后,在块/product/new.php中,我有:
class Mage_Catalog_Block_Product_New extends Mage_Catalog_Block_Product_Abstract{
protected function _construct()
{
parent::_construct();
Mage::log("0:testing",null,'jase.log');
Mage::log("1:".$this->blerg,null,'jase.log');
Mage::log("2:".$blerg,null,'jase.log');
Mage::log("3:".$this->getData('blerg'),null,'jase.log');
Mage::log("4:".$this->getBlerg(),null,'jase.log');然后在我的日志里我看到:
为什么我不能看到我的可变值- "moo"?
发布于 2013-06-05 05:46:54
尝试以下几点
Mage::app()->getRequest()->getParam('blerg');https://stackoverflow.com/questions/16931519
复制相似问题