Ravichandran Jothi
Ravichandran Jothi

Reputation: 3066

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

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

Answers (2)

Ravichandran Jothi
Ravichandran Jothi

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

anz
anz

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

Related Questions