Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.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
Magento indexController不';t触发器_Magento_Controller - Fatal编程技术网

Magento indexController不';t触发器

Magento indexController不';t触发器,magento,controller,Magento,Controller,我正在Magento开发massgrid选项。问题是我的indexController没有加载。我认为我的类的声明中有一个问题 这是我的config.xml <config> <global> <blocks> <adminhtml> <rewrite> <sales_order_grid>Comp_Dhl

我正在Magento开发massgrid选项。问题是我的indexController没有加载。我认为我的类的声明中有一个问题

这是我的config.xml

<config>
    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <sales_order_grid>Comp_Dhl_Block_Sales_Order_Grid</sales_order_grid>
                </rewrite>
                <events>
                    <core_block_abstract_prepare_layout_before>
                        <observers>
                            <Dhl_core_block_abstract_prepare_layout_before>
                                <class>Dhl/observer</class>
                                <method>addMassAction</method>
                            </Dhl_core_block_abstract_prepare_layout_before>
                        </observers>
                    </core_block_abstract_prepare_layout_before>
                </events>
            </adminhtml>
        </blocks>
        <admin>
        <routers>
            <todhl>
                <use>admin</use>
                <args>
                    <module>Comp_Dhl</module>
                    <frontName>todhl</frontName>
                </args>
            </todhl>
        </routers>
    </admin>
    </global>
</config>
mass选项:“发送到[DHL]”显示良好。因为我的url中有这个:
$this->getUrl('/*/*/toDhl')
我必须将:
公共函数toDhlAction()
添加到我的indexController.php中

我的indexController.php看起来像:

class Comp_Dhl_IndexController extends Mage_Adminhtml_Controller_Action
{
    public function toDhlAction(){      
        mail('to@me.com', 'controller works', 'the mass action controller works');
        $this->_redirect('*/*/index');
    }
}
这就是问题所在,因为我没有收到indexController.php应该触发的电子邮件


有什么想法吗?

你认为你的控制器触发的URL是什么?还有,你的模块的相关配置是什么,即
admin/routers/adminhtml/args/modules/…
,你确定它被加载了吗?我已经更新了帖子,并在选择批量操作时添加了config.xml,它会转到:'/*/*/toDhl'(参见my Grid.php)
class Comp_Dhl_IndexController extends Mage_Adminhtml_Controller_Action
{
    public function toDhlAction(){      
        mail('to@me.com', 'controller works', 'the mass action controller works');
        $this->_redirect('*/*/index');
    }
}