Mage_Core_Block_Abstract::getHelper()
The method Mage_Core_Model_Layout::getBlockSingleton()does not return a Magento helper object, but rather an instance of a block of type of a Magento object.
I believe that this is deprecated code, for example, the method is Mage::getBlockSingleton()deprecated.
In both cases, a block instance is created from the Magento class identifier.
getBlockSingleton() $_helpers , createBlock() $_blocks.
$_blocks ( ) XML.
getBlockSingleton() , , , , .
() , createBlock(), :
public function alternativeGetBlockSingleton($classId)
{
foreach (Mage::app()->getLayout()->getAllBlocks() as $block)
{
if ($block->getType() == $classId)
{
return $block;
}
}
return $this->createBlock($classId);
}
Mage_Core_Block_Abstract::helper()
Mage_Core_Block_Abstract::helper() , Magento .
Mage::helper($name) , .
, $this->helper() , Mage::helper(), (, , ) Mage, Magento , Mage Mage_Core.
, , , , , Mage::helper() , , .
, Magento .