本文整理汇总了PHP中Mage_Core_Block_Abstract::getIsAnonymous方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Block_Abstract::getIsAnonymous方法的具体用法?PHP Mage_Core_Block_Abstract::getIsAnonymous怎么用?PHP Mage_Core_Block_Abstract::getIsAnonymous使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Block_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Block_Abstract::getIsAnonymous方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setChild
/**
* Set child block
*
* @param string $alias
* @param Mage_Core_Block_Abstract|string $block
* @return Mage_Core_Block_Abstract
*/
public function setChild($alias, $block)
{
$layout = $this->getLayout();
if (!$layout) {
return $this;
}
$thisName = $this->getNameInLayout();
if ($layout->getChildName($thisName, $alias)) {
$this->unsetChild($alias);
}
if ($block instanceof self) {
if ($block->getIsAnonymous()) {
$block->setNameInLayout($this->getNameInLayout() . '.' . $alias);
}
$block = $block->getNameInLayout();
}
$layout->setChild($thisName, $block, $alias);
return $this;
}
示例2: insert
/**
* Insert child block
*
* @param Mage_Core_Block_Abstract $block
* @param string $siblingName
* @param boolean $after
* @param string $alias
* @return object $this
*/
public function insert($block, $siblingName = '', $after = false, $alias = '')
{
if ($block->getIsAnonymous()) {
$this->setChild('', $block);
$name = $block->getNameInLayout();
} elseif ('' != $alias) {
$this->setChild($alias, $block);
$name = $block->getNameInLayout();
} else {
$name = $block->getNameInLayout();
$this->setChild($name, $block);
}
if ('' === $siblingName) {
if ($after) {
array_push($this->_sortedChildren, $name);
} else {
array_unshift($this->_sortedChildren, $name);
}
} else {
$key = array_search($siblingName, $this->_sortedChildren);
if (false !== $key) {
if ($after) {
$key++;
}
array_splice($this->_sortedChildren, $key, 0, $name);
} else {
if ($after) {
array_push($this->_sortedChildren, $name);
} else {
array_unshift($this->_sortedChildren, $name);
}
}
}
return $this;
}
示例3: testSetGetIsAnonymous
public function testSetGetIsAnonymous()
{
$this->assertFalse($this->_block->getIsAnonymous());
$this->_block->setIsAnonymous(true);
$this->assertTrue($this->_block->getIsAnonymous());
}