0
我有2個文件爲我的模塊:ETC/config.xml和型號/ Observer.phpMagento:爲什麼Observer中的公共功能無法正常工作?
的Config.xml:
<config>
<global>
<cache>
<types>
<DN_js_module module="COMP_dn_js" translate="DN Cache">
<label>DN Cache (JS CSS)</label>
<description>Refresh Javascript and CSS (DN)</description>
<tags>COMP_DN_JSCSS</tags>
</DN_js_module>
</types>
</cache>
<events>
<DN_trigger>
<observers>
<comp_dncache>
<type>singleton</type>
<class>dncache/observer</class>
<method>setCache</method>
</comp_dncache>
</observers>
</DN_trigger>
</events>
</global>
</config>
Observer.php:
class COMP_DNCache_Model_Observer extends Mage_Adminhtml_CacheController
{
public function __construct(){
}
public function setCache($observer){
die('test');
}
}
因此,config.xml在Magento的緩存列表中增加了一個額外的選項。當它刷新時,我希望公共函數setCache()運行,並且(在這種情況下)顯示輸出:'test'
現在問題是,setCache沒有觸發,我無法'測試'到showup :-(