3
我知道我必須在這裏丟失一些明顯的東西..但我只是看不到缺少的東西。我已通過觀測加在客戶中電網新的自定義質量行動,下面的代碼:Magento批量操作URL結果爲404
public function addMassActions($observer) {
$block = $observer->getEvent()->getBlock();
if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
&& $block->getRequest()->getControllerName() == 'customer')
{
$statuses = Mage::getSingleton('tmcustomerapproval/approvals')->getStatuses();
$block->addItem('tmcustomerapproval', array(
'label' => 'Set Customer Approval Status',
'url' => Mage::getModel('adminhtml/url')->getUrl('adminhtml/customerapproval/index'),
'additional' => array(
'visibility' => array(
'name' => 'status',
'type' => 'select',
'class' => 'required-entry',
'label' => Mage::helper('tmcustomerapproval')->__('Status'),
'values' => $statuses
)
)
));
}
}
這工作得很好。這個動作出現了。然而在點擊提交我得到的前端404在config.xml中我有:
<admin>
<routers>
<adminhtml>
<args>
<modules>
<Tweakmag_CustomerApproval after="Mage_Adminhtml">Tweakmag_CustomerApproval</Tweakmag_CustomerApproval>
</modules>
</args>
</adminhtml>
</routers>
</admin>
和控制器本身存儲在:/app/code/community/Tweakmag/CustomerApproval/controllers/Customerapproval.php
,並具有以下的代碼:
class Tweakmag_CustomerApproval_CustomerapprovalController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
}
}
我已清除緩存,登錄/退出等的幫助,非常感謝,所以我可以繼續享受週末:) 感謝 亞當
已解決!並懷疑。是一個簡單的錯誤。控制器文件名不正確。應該是CustomerapprovalController.php – tweakmag