I am trying to print some products using partial loops in Zend Framework. I am using this code in my view:
echo $this->partialLoop()->setObjectKey('product') >partialLoop('/_loops/singleProduct.phtml', $this->last_products);
It works, but I don't know how to use that parameter $this->last_products. I tried in singleProduct.php this code:
echo $this->product['name'];
but I've got an error:
Notice: Key "product" does not exist in /usr/share/php/libzend-framework-php/Zend/View/Abstract.php on line 270
Actually, what I am triyng to write is $this->last_products['name'], but because I have partialLoop()->setObjectKey('product') I tought this is how it works. What am I doing wrong?
Thank you!
$this->last_products? Is it an array?echo $this->last_products['name'];