/** * 重定向请求到新的action操作 * * 该种重定向类型,是中断当前的请求执行过程,开启另外的action操作处理.是在一次请求内部进行重定向, * 所以之前的一些处理的结果变量,在重定向后是会继续存在,并可通过forward变量进行访问的.也就是不仅仅是过程的重定向, * 也是状态的重定向. * @param WindForward $forward * @param WindRouter $router * @param boolean $display * @return void */ protected function dispatchWithAction($forward, $router, $display) { if (!($action = $forward->getAction())) { throw new WindException('[web.WindDispatcher.dispatchWithAction] forward fail.', WindException::ERROR_PARAMETER_TYPE_ERROR); } $this->display = $display; list($_a, $_c, $_m, $arg) = WindUrlHelper::resolveAction($action); foreach ($arg as $key => $value) { $_GET[$key] = $value; } foreach ($forward->getArgs() as $key => $value) { $_POST[$key] = $value; } $_a && $router->setAction($_a); $_c && $router->setController($_c); $_m && $router->setModule($_m); Wind::getApp()->run(); }
/** * 重定向请求到新的action操作 * * 该种重定向类型,是中断当前的请求执行过程,开启另外的action操作处理.是在一次请求内部进行重定向, * 所以之前的一些处理的结果变量,在重定向后是会继续存在,并可通过forward变量进行访问的.也就是不仅仅是过程的重定向, * 也是状态的重定向. * @param WindForward $forward * @param WindRouter $router * @param boolean $display * @return void */ protected function dispatchWithAction($forward, $router, $display) { if (!($action = $forward->getAction())) { throw new WindException('[web.WindDispatcher.dispatchWithAction] forward fail.', WindException::ERROR_PARAMETER_TYPE_ERROR); } $this->display = $display; list($_a, $_c, $_m) = WindUrlHelper::resolveAction($action); if ($_var = $forward->getArgs()) { $this->getResponse()->setData($_var, 'F'); } $_a && $router->setAction($_a); $_c && $router->setController($_c); $_m && $router->setModule($_m); Wind::getApp()->run(); }