[英]Magento 1.9 Enable Disable Module From Admin Panel
我有一個任務來創建一個覆蓋某些phtml文件的Magento模塊,但是,作為任務要求,我需要通過system->configuration,
來控制該模塊system->configuration,
是為該模塊創建一個選項卡,然后選擇enable disable the module
。
考慮到模塊包含要覆蓋的phtml文件,我如何才能做到這一點。
謝謝,
通常,我更喜歡創建將呈現那些模板的塊,然后,您可以使用override _toHtml
方法並在那里實現邏輯。 與Mage_Core_Block_Template
相似。
class Namespace_Module_Block_Template extends Mage_Core_Block_Template
{
...
protected function _toHtml()
{
if (!this->_isEnabled()) {
return '';
}
return parent::_toHtml();
}
...
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.