从 magento 中的一个管理控制器重定向到另一个管理控制器中的函数

Redirect to a function in another admin controller from one admin controller in magento

我必须从一个控制器调用一个函数到另一个控制器。

我需要从 testController 中的 testAction() 调用一个函数到 anotherController 中的 indexAction()。

我怎么称呼那个。我试过下面的。但这似乎不起作用。请多多指教。

$this->_redirect("./admin/another/index", array("group_id" => $group_id));

$this->_forward($action = 'indexAction', $controller = 'adminhtml_another', $module = 'custommodule');

如果您要从一个控制器重定向到另一个控制器

$this->_redirect('customer/account/login'); 
//Format: $this->_redirect('module/controller/action');

如果在同一个控制器中

//$this->_redirect('*/*/SameControllerMethodAction');

更新: 您的解决方案:

$this->_redirect('adminhtml/newsletter_template/index'); 

Adminhtml - module
Newsletter (Folder) > Template - controller
Index - function

我找到了答案。现在重定向工作正常。我刚刚在下面添加了 'return;' 声明。代码是,

$this->_redirect("adminhtml/newsletter_template/"); 
return;