Api Zend框架模块化应用程序?
我是Zend模块化应用程序的新手。我有一个api控制器,我想从这个控制器调用其他模块。例如,将数据发送到此地址:Api Zend框架模块化应用程序?,api,zend-framework,module,Api,Zend Framework,Module,我是Zend模块化应用程序的新手。我有一个api控制器,我想从这个控制器调用其他模块。例如,将数据发送到此地址: http://localhost/api/addTask 我添加了一个自定义路由,将所有请求重定向到api/索引 现在,如何通过索引调用模块或其他方法? 例如: function indexAction() { $params = $this->getRequets()->getParams(); $controller = $params[0];//I
http://localhost/api/addTask
我添加了一个自定义路由,将所有请求重定向到api/索引现在,如何通过索引调用模块或其他方法?
例如:
function indexAction()
{
$params = $this->getRequets()->getParams();
$controller = $params[0];//I know that there is issues with this line but keep going...
//module name is addTask
//call to module or controller addTask
}
提前感谢您可以使用\u forward()
从控制器调用其他操作\u向前($action,$controller=null,$module=null,array$params=null):
这里是到ZF手册的链接这在ZF 2.0.x中更容易实现