2013-12-08 21 views
9

我知道:Magento:爲所有孩子阻止unsetChild?

<action method="unsetChild"><name>as</name></action> 

是否可以去除所有的孩子在同一行?例如:

<action method="unsetChild"><name>*</name></action> 

或類似的東西..?

更新 - 答:

<action method="unsetChildren"/> 

似乎這樣的伎倆相當不錯..

回答

8

不要害怕閱讀基地塊類的源文件。

#File: app/code/core/Mage/Core/Block/Abstract.php 
public function unsetChildren() 
{ 
    $this->_children  = array(); 
    $this->_sortedChildren = array(); 
    return $this; 
} 

無數答案在這些方法。

+0

@AlanStrom我讀過源代碼,這就是爲什麼我更新了問題的答案(發佈答案前一個小時):) – user76568

+0

瀏覽器選項卡 - 它們保持打開狀態。 –

相關問題