Reputation: 3066
I have to call a function from one controller to another controller.
I need to call a function from testAction() in testController to indexAction() in anotherController.
How could i call that one. I tried below ones. but that doesn't seems to work. Please advice me.
$this->_redirect("./admin/another/index", array("group_id" => $group_id));
$this->_forward($action = 'indexAction', $controller = 'adminhtml_another', $module = 'custommodule');
Upvotes: 1
Views: 1998
Reputation: 3066
I found the answer. now redirection working fine. i have just add below 'return;'
statement. the code is,
$this->_redirect("adminhtml/newsletter_template/");
return;
Upvotes: 2
Reputation: 1042
If you are redirecting from one controller to another
$this->_redirect('customer/account/login');
//Format: $this->_redirect('module/controller/action');
If in the same controller
//$this->_redirect('*/*/SameControllerMethodAction');
UPDATED: Your solution :
$this->_redirect('adminhtml/newsletter_template/index');
with
Adminhtml - module
Newsletter (Folder) > Template - controller
Index - function
Upvotes: 4