【发布时间】:2011-09-05 08:26:55
【问题描述】:
我在 Magento 管理面板中的模块的 URL 类似于 http://example.com/index.php/mymodule/... 并包含带有订单的自定义网格。当用户单击网格行时,我想将用户重定向到标准的“订单视图”页面。
public function getRowUrl($row)
{
if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
return $this->getUrl('sales_order/view', array('order_id' => $row->getId()));
}
return false;
}
但是这个 URL 指向 http://example.com/index.php/sales_order/view/... 而不是 http://example.com/index.php/admin/sales_order/view/... 有什么建议吗?
UPD。 config.xml:
<admin>
<routers>
<mymodule>
<use>admin</use>
<args>
<module>Foo_Mymodule</module>
<frontName>mymodule</frontName>
</args>
</mymodule>
</routers>
</admin>
【问题讨论】:
-
@clockworkgeek 谢谢。请看我更新的帖子。它看起来类似于 config.xml 的情况,不是吗?
-
您的
frontName是mymodule,但如果您更仔细地复制示例,它将能够改用admin。 -
我的控制器有一个路径
Foo/Mymodule/Adminhtml/MymoduleController.php我尝试设置<adminhtml> <args><modules><mymodule after="Mage_Adminhtml">Foo_Mymodule_Adminhtml_Mymodule</mymodule> </modules></args></adminhtml>而不是当前配置,但尝试访问模块主页时http://example.com/index.php/admin/mymodule/mymodule/index出现404 错误。