Forwards the request to another controller.
public forward ( string $controller, array $attributes = [], array $query = [] ) : Response | ||
$controller | string | The controller name (a string like BlogBundle:Post:index) |
$attributes | array | An array of request attributes |
$query | array | An array of request query parameters |
return | Response | A Response instance |
/** * @param Request $request * @param null|AuthenticationException $authException * @return Response */ public function start(Request $request, AuthenticationException $authException = null) { $action = $this->config['login_action']; $manager = $this->factory->getManager($this->config['manager'], $request->getUriForPath($this->config['check_path'])); if ($action) { return $this->httpKernel->forward($action, array('manager' => $manager, 'request' => $request, 'exception' => $authException)); } return new RedirectResponse($manager->getServer()->getLoginUrl()); }
/** * @param Request $request * @param null|AuthenticationException $authException * * @return Response */ public function onLogoutSuccess(Request $request) { $action = $this->config['logout_action']; $manager = $this->factory->getManager($this->config['manager'], $request->getUriForPath($this->config['check_path'])); if ($action) { return $this->httpKernel->forward($action, array('manager' => $manager, 'request' => $request)); } return new RedirectResponse($manager->getServer()->getLogoutUrl()); }