"Fossies" - the Fresh Open Source Software Archive

Member "contao-4.4.48/core-bundle/src/Exception/AjaxRedirectResponseException.php" (2 Apr 2020, 826 Bytes) of package /linux/www/contao-4.4.48.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "AjaxRedirectResponseException.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 /*
    4  * This file is part of Contao.
    5  *
    6  * (c) Leo Feyer
    7  *
    8  * @license LGPL-3.0-or-later
    9  */
   10 
   11 namespace Contao\CoreBundle\Exception;
   12 
   13 use Symfony\Component\HttpFoundation\Response;
   14 
   15 /**
   16  * Initializes a response exception with an Ajax compatible redirect response.
   17  *
   18  * @author Christian Schiffler <https://github.com/discordier>
   19  * @author Leo Feyer <https://github.com/leofeyer>
   20  */
   21 class AjaxRedirectResponseException extends ResponseException
   22 {
   23     /**
   24      * Constructor.
   25      *
   26      * @param string          $location
   27      * @param int             $status
   28      * @param \Exception|null $previous
   29      */
   30     public function __construct($location, $status = 302, \Exception $previous = null)
   31     {
   32         parent::__construct(new Response($location, $status, ['X-Ajax-Location' => $location]), $previous);
   33     }
   34 }