How to call function of another block Magento

Hi you can do it by creating reference to that Block.Like

 $cpBlock = $this->getLayout()->getBlockSingleton('your block class'); //ect Mage_Catalog_Block_Product_List_Toolbar

Than you can easily call every function of that class like $cpBlock->getLinks();.Other way is using XML block code.Add contact us xml reference just like user2338443 mentioned to your custom xml and than access functions of that block.


block to block calling

Also try call other block class method from current template block class.

$s = Mage::app()->getLayout()->getBlockSingleton('myproductfamily/family');
        print_r($s->getCollection($collectionId));exit;

where: myproductfamily = ModuleName

family = blockClass

Tags:

Magento