magento - 如何在 Magento 中从我的 Controller 操作重定向或调用不同的 Controller 操作?

标签 magento redirect controller action call

我想从我的自定义模块的 Controller 操作之一调用 cms/index/noRoute 操作,我该怎么做?

我试过了,

$this->_redirectUrl('cms/index/noRoute')

$this->_forward('cms/index/noRoute')

重定向 URL 的变体也很少,例如“*/cms/index/noRoute”等,但没有一个有效。我应该怎么做?

最佳答案

使用下面的代码:

$this->_redirect('defaultNoRoute');
return;

它对我有用。

关于magento - 如何在 Magento 中从我的 Controller 操作重定向或调用不同的 Controller 操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16475872/

相关文章:

Magento 日期文本 : where does it come from and how can I change it?

javascript - 在 http 重定向中维护 anchor

JavaScript 指令没有像我想象的那样工作

asp.net-mvc-3 - 在 Controller 中从 MVC3 部分 View 访问模型数据,而不在 View 中显式传递它

javascript - 更改 URL 并保留下拉 onChange 事件中的值

Magento:如何覆盖一个模板文件

magento - 指定以编程方式创建的优惠券代码的操作

javascript - 页面重定向到另一个页面后输入凭据

c - 使用 dup2 系统调用重定向输出的奇怪问题

asp.net-mvc-3 - 在 Controller 上声明 ViewBag