且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何覆盖Magento控制器?

更新时间:2023-02-12 12:31:15

除了修改core之外,其他任何事情都很好.这样,用config.xml创建一个带有controllers目录等的简单模块:

Anything besides modifying the core is good in my opinion. With that said create a simple module with a controllers directory and etc with config.xml:

<config>
    <frontend>
        <routers>
            <checkout>
                <args>
                    <modules>
                         <My_Module before="Mage_Checkout">My_Module_Checkout</My_Module>
                    </modules>
                </args>
            </checkout>
        </routers>
    </frontend>
</config>

有关如何扩展前端控制器的更多详细信息,请参见此处: http://prattski.com/2010/06/24 /magento-overriding-core-files-blocks-models-resources-controllers/

See here for more details on how to extend the frontend controller: http://prattski.com/2010/06/24/magento-overriding-core-files-blocks-models-resources-controllers/