‪TYPO3CMS  10.4
RedirectResponse.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
16 namespace ‪TYPO3\CMS\Core\Http;
17 
18 use Psr\Http\Message\UriInterface;
19 
28 {
37  public function ‪__construct($uri, $status = 302, array ‪$headers = [])
38  {
39  if (!is_string($uri) && !($uri instanceof UriInterface)) {
40  throw new \InvalidArgumentException(
41  'The given uri be a string or UriInterface - '
42  . (is_object($uri) ? get_class($uri) : gettype($uri)) . ' given',
43  1504814459
44  );
45  }
46  ‪$headers['location'] = [(string)$uri];
47  parent::__construct('php://temp', $status, ‪$headers);
48  }
49 }
‪TYPO3\CMS\Core\Http\RedirectResponse\__construct
‪__construct($uri, $status=302, array $headers=[])
Definition: RedirectResponse.php:37
‪TYPO3\CMS\Core\Http\Response
Definition: Response.php:30
‪TYPO3\CMS\Core\Http\RedirectResponse
Definition: RedirectResponse.php:28
‪TYPO3\CMS\Core\Http\Message\$headers
‪array $headers
Definition: Message.php:40
‪TYPO3\CMS\Core\Http
Definition: AbstractApplication.php:18