【发布时间】:2018-08-09 12:19:44
【问题描述】:
在我的CustomerclientController 中的reentryAction 内,我想转发到indexAction,以防发布参数的有效性检查成功。
不幸的是,前锋不起作用。在调试时,我确定将再次调用reentryAction 方法,而不是indexAction。
我在services.php 中注册了一个 Dispatcher,如下所示:
$di->setShared('dispatcher', function() use ($eventsManager) {
$dispatcher = new MvcDispatcher();
// Bind the eventsManager to the view component
$dispatcher->setEventsManager($eventsManager);
return $dispatcher;
});
客户客户端控制器:
class CustomerclientController extends Controller {
public function reentryAction($hash) {
// ... a lot of code
if ($this->request->isPost()) {
// ... a lot of code
if ($valid) {
$this->dispatcher->forward([
"customerclient",
"index"
]);
return;
}
}
}
public function indexAction() {
//Does something wise
}
}
我没有定义特殊的路线,也没有使用route.php 文件。
我做错了什么或忘记了什么?
提前感谢您的帮助!
【问题讨论】:
标签: php model-view-controller php-7 phalcon phalcon-routing