Files
lichterei-web/kirby/src/Cms/Response.php
Bastian Allgeier 447a9dd266 Upgrade to 3.2.5
2019-09-24 11:00:59 +02:00

31 lines
725 B
PHP
Executable File

<?php
namespace Kirby\Cms;
/**
* Custom response object with an optimized
* redirect method to build correct Urls
*
* @package Kirby Cms
* @author Bastian Allgeier <bastian@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier GmbH
* @license https://getkirby.com/license
*/
class Response extends \Kirby\Http\Response
{
/**
* Adjusted redirect creation which
* parses locations with the Url::to method
* first.
*
* @param string $location
* @param int $code
* @return self
*/
public static function redirect(?string $location = null, ?int $code = null)
{
return parent::redirect(Url::to($location ?? '/'), $code);
}
}