本文整理汇总了PHP中Mage_Core_Block_Abstract::getChildGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Block_Abstract::getChildGroup方法的具体用法?PHP Mage_Core_Block_Abstract::getChildGroup怎么用?PHP Mage_Core_Block_Abstract::getChildGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Block_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Block_Abstract::getChildGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddToParentGroup
public function testAddToParentGroup()
{
list($blocks, ) = $this->_createSampleBlocks(2);
$this->_block->append($blocks[0], 'block1')->append($blocks[1], 'block2');
$blocks[0]->addToParentGroup('group');
$blocks[1]->addToParentGroup('group');
$group = $this->_block->getChildGroup('group');
$this->assertArrayHasKey('block1', $group);
$this->assertArrayHasKey('block2', $group);
$this->assertSame($group['block1'], $blocks[0], 'The same instance is expected.');
$this->assertSame($group['block2'], $blocks[1], 'The same instance is expected.');
}
示例2: getActionHtml
/**
* @param Mage_Core_Block_Abstract $block
* @return string
*/
public function getActionHtml($block)
{
$html = '';
$actions = $block->getChildGroup('actions');
uasort($actions, array($this, 'compareBySortOrder'));
foreach ($actions as $alias => $action) {
/* @var $action Mana_Admin_Block_Action */
$params = $action->getData();
$this->copyParam($params, 'title', 'label');
$action->setData($params);
$html .= $block->getChildHtml($alias);
}
return $html;
}