Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我应该在config.xml文件中添加什么来覆盖可下载(Magento controller)中的linkAction?_Php_Magento_Controller - Fatal编程技术网

Php 我应该在config.xml文件中添加什么来覆盖可下载(Magento controller)中的linkAction?

Php 我应该在config.xml文件中添加什么来覆盖可下载(Magento controller)中的linkAction?,php,magento,controller,Php,Magento,Controller,我正试图覆盖linkAction方法,以便在S3中提供可下载内容,等等。这在Magento 1.3分支中变得相当容易。你所需要做的就是添加 <frontend> <routers> <downloadable> <args> <modules> <modulename before="Mage_Downloadable">Yourpack

我正试图覆盖linkAction方法,以便在S3中提供可下载内容,等等。

这在Magento 1.3分支中变得相当容易。你所需要做的就是添加

<frontend>
    <routers>
       <downloadable>
         <args>
           <modules>
             <modulename before="Mage_Downloadable">Yourpackagename_Yourmodulename</modulename>
           </modules>
         </args>
       </downloadable>
    </routers>
</frontend>
如果没有找到匹配的操作,它将返回到原始操作。请务必查看我的文章以获取调试路由问题的帮助

这种方法(与传统方法相反)最棒的是你自己

  • 不需要手动要求控制器中的旧控制器文件

  • 您不需要提供新的布局规则。Magento似乎神奇地保持了布局控制柄的原样

  • app/code/local/Packagename/Modulename/controllers/DownloadController.php