Posted By

silky on 01/22/11


Tagged


Versions (?)

How to call a Block Class Method from a View


 / Published in: PHP
 

URL: http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/call_class_method_from_view

  1. $className = Mage::getConfig()->getBlockClassName('mycompany_catalog/product_list');
  2. $block = new $className();
  3. $block->_prepareData();
  4. if($block->getItems()->getSize()){
  5. $items = $block->getItems();
  6. foreach($items as $_item){
  7. // your code...
  8. }
  9. }

Report this snippet  

You need to login to post a comment.