/** * Redirects the user to another URL. * * @param string $path The path info to redirect to. * @param string $route The route that matched * @param string $scheme The URL scheme (null to keep the current one) * * @return array An array of parameters */ public function redirect($path, $route, $scheme = null) { $array = parent::redirect($path, $route, $scheme); // Make sure that the kernel knows how to properly handle this route $array['_defaultHandler'] = true; return $array; }
public function redirect($path, $route, $scheme = null, $logPath = null) { if ($logPath) { $logger = new Logger('redirect'); $logger->pushHandler(new StreamHandler($logPath, Logger::INFO)); $logger->addInfo('redirect', ['url' => $this->context->getPathInfo() . '?' . $this->context->getQueryString(), 'location' => $path, 'method' => $this->context->getMethod()]); } return parent::redirect($path, $route, $scheme); }