class MyController extends Zend_Controller_Action { public function indexAction() { $request = $this->getRequest(); $category = $request->getParam('category'); // Set the controller name based on the category parameter $request->setControllerName($category); // Process the request using the new controller name $this->_forward('view'); } public function viewAction() { // Controller code for viewing a category } }
class MyController extends Zend_Controller_Action { public function indexAction() { $request = $this->getRequest(); if ($request->isPost()) { // Set the controller name based on user input $request->setControllerName($request->getPost('controller')); // Process the request using the new controller name $this->_forward('action'); } } public function actionAction() { // Controller code for the requested action } }In this example, the controller name is set based on user input submitted through a POST request. The code then forwards the request to the appropriate action, which will process the request using the new controller name.