MediaWiki master
MediaWiki\Rest\RedirectException Class Reference

This is an exception class that extends HttpException and will generate a redirect when handled. More...

Inherits MediaWiki\Rest\HttpException.

Collaboration diagram for MediaWiki\Rest\RedirectException:

Public Member Functions

 __construct (int $code, string $target)
 
 getTarget ()
 
- Public Member Functions inherited from MediaWiki\Rest\HttpException
 __construct ( $message, $code=500, $errorData=[])
 
 getErrorData ()
 

Detailed Description

This is an exception class that extends HttpException and will generate a redirect when handled.

It is used when a redirect is treated as an exception output in your API, and you want to be able to throw it from wherever you are and immediately halt request processing.

Stability: newable
Since
1.36

Definition at line 15 of file RedirectException.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Rest\RedirectException::__construct ( int $code,
string $target )
Stability: stable
to call
Parameters
int$codeThe HTTP status code (3xx) for this redirect
string$targetThe redirect target (an absolute URL)

Definition at line 29 of file RedirectException.php.

Member Function Documentation

◆ getTarget()

MediaWiki\Rest\RedirectException::getTarget ( )
Returns
string

Definition at line 37 of file RedirectException.php.


The documentation for this class was generated from the following file: