我不知道我做錯了什麼:Magento的延長getCssJsHtml()
我有這樣的事情:
app/code/local/Company/etc/confix.xml:
<?xml version="1.0"?>
<config>
<modules>
<Company_Core>
<version>0.1.0</version>
</Company_Core>
</modules>
<global>
<models>
<core>
<rewrite>
<store>Company_Page_block_Html_Head</Store>
</rewrite>
</core>
</models>
</global>
</config>
而且
app/code/local/Company/Page/Block/Html/Head.php:
include('Mage/Page/Block/Html/Head.php');
class Company_Page_block_Html_Head extends Mage_Catalog_Model_Product {
/**
* Get HEAD HTML with CSS/JS/RSS definitions
* (actually it also renders other elements, TODO: fix it up or rename this method)
*
* @return string
*/
public function getCssJsHtml()
{
echo 'asd';
return parent::getCssJsHtml();
}
}
但是沒有什麼變化,我調試文本「asd」根本沒有顯示,我不知道我可能做錯了什麼?
我跑Magento的1.9 CE
試試糾正您的案例 – RichTea 2014-10-28 16:43:24
如果您覺得有幫助,請接受答案 – 2015-07-16 07:04:41