本文整理汇总了PHP中Mage_Core_Model_Layout::addContainer方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Layout::addContainer方法的具体用法?PHP Mage_Core_Model_Layout::addContainer怎么用?PHP Mage_Core_Model_Layout::addContainer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Layout
的用法示例。
在下文中一共展示了Mage_Core_Model_Layout::addContainer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testToHtmlWithContainer
public function testToHtmlWithContainer()
{
$listName = $this->_block->getNameInLayout();
$block1 = $this->_layout->addBlock('Mage_Core_Block_Text', '', $listName);
$this->_layout->addContainer('container', 'Container', array(), $listName);
$block2 = $this->_layout->addBlock('Mage_Core_Block_Text', '', 'container');
$block3 = $this->_layout->addBlock('Mage_Core_Block_Text', '', $listName);
$block1->setText('text1');
$block2->setText('text2');
$block3->setText('text3');
$html = $this->_block->toHtml();
$this->assertEquals('text1text2text3', $html);
}
示例2: testGetElementAlias
public function testGetElementAlias()
{
$this->_layout->addContainer('one', 'One');
$this->_layout->addContainer('two', 'One', array(), 'one', '1');
$this->assertFalse($this->_layout->getElementAlias('one'));
$this->assertEquals('1', $this->_layout->getElementAlias('two'));
}
示例3: testReorderChild
/**
* @param Mage_Core_Model_Layout $layout
* @depends testSetChild
*/
public function testReorderChild(Mage_Core_Model_Layout $layout)
{
$layout->addContainer('four', 'Four', array(), 'one');
// offset +1
$layout->reorderChild('one', 'four', 1);
$this->assertSame(array('two', 'four', 'three'), $layout->getChildNames('one'));
// offset -2
$layout->reorderChild('one', 'three', 2, false);
$this->assertSame(array('two', 'three', 'four'), $layout->getChildNames('one'));
// after sibling
$layout->reorderChild('one', 'two', 'three');
$this->assertSame(array('three', 'two', 'four'), $layout->getChildNames('one'));
// after everyone
$layout->reorderChild('one', 'three', '-');
$this->assertSame(array('two', 'four', 'three'), $layout->getChildNames('one'));
// before sibling
$layout->reorderChild('one', 'four', 'two', false);
$this->assertSame(array('four', 'two', 'three'), $layout->getChildNames('one'));
// before everyone
$layout->reorderChild('one', 'two', '-', false);
$this->assertSame(array('two', 'four', 'three'), $layout->getChildNames('one'));
}