伙计们。
我需要覆盖不同类中的2个函数(CatalogSearch/Layer.php和CatalogSearch/Mysql4/Fulltext/Collection.php).所以,我有一个配置文件:
<config>
<modules>
<my_modulename>
<version>0.1</version>
</my_modulename>
</modules>
<global>
<models>
<catalogsearch>
<rewrite>
<layer>My_Modulename_Model_CatalogSearch_Layer</layer>
<mysql4_fulltext_collection>My_Modulename_Model_CatalogSearch_Mysql4_Fulltext_Collection </mysql4_fulltext_collection>
</rewrite>
</catalogsearch>
</models>
</global>
</config>因此,Layer.php已被正确覆盖,但Collection.php并非如此--甚至没有包含'/local/My/Modulename/Model/CatalogSearch/Mysql4/Fulltext/Collection.php‘。为什么?
谢谢你的帮助。
发布于 2011-07-05 05:10:29
资源模型可能是单独处理的,请尝试这样做:
<global>
<models>
<catalogsearch>
<rewrite>
<layer>My_Modulename_Model_CatalogSearch_Layer</layer>
</rewrite>
</catalogsearch>
<catalogsearch_mysql4>
<rewrite>
<fulltext_collection>My_Modulename_Model_CatalogSearch_Mysql4_Fulltext_Collection</fulltext_collection>
</rewrite>
</catalogsearch_mysql4>
</models>
</global>https://stackoverflow.com/questions/6575826
复制相似问题