PHP 클래스 Psr7Middlewares\Middleware\BasePath

상속: use trait Psr7Middlewares\Utils\BasePathTrait
파일 보기 프로젝트 열기: oscarotero/psr7-middlewares 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string | null $basePath = null ) Constructor. Set the path prefix.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
autodetect ( boolean $autodetect = true ) : self Autodetect the basePath.
getBasePath ( Psr\Http\Message\ServerRequestInterface $request ) : string | null Returns the basePath.
getGenerator ( Psr\Http\Message\ServerRequestInterface $request ) : callable | null Returns a callable to build a full path.

비공개 메소드들

메소드 설명
detectBasePath ( Psr\Http\Message\ServerRequestInterface $request ) : string Auto-detect the base path from the request environment.

메소드 상세

__construct() 공개 메소드

Constructor. Set the path prefix.
public __construct ( string | null $basePath = null )
$basePath string | null

__invoke() 공개 메소드

Execute the middleware.
public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\ServerRequestInterface
$response Psr\Http\Message\ResponseInterface
$next callable
리턴 Psr\Http\Message\ResponseInterface

autodetect() 공개 메소드

Autodetect the basePath.
public autodetect ( boolean $autodetect = true ) : self
$autodetect boolean
리턴 self

getBasePath() 공개 정적인 메소드

Returns the basePath.
public static getBasePath ( Psr\Http\Message\ServerRequestInterface $request ) : string | null
$request Psr\Http\Message\ServerRequestInterface
리턴 string | null

getGenerator() 공개 정적인 메소드

Returns a callable to build a full path.
public static getGenerator ( Psr\Http\Message\ServerRequestInterface $request ) : callable | null
$request Psr\Http\Message\ServerRequestInterface
리턴 callable | null