PHP 클래스 Psr7Middlewares\Middleware\Geolocate

상속: use trait Psr7Middlewares\Utils\StorageTrait
파일 보기 프로젝트 열기: oscarotero/psr7-middlewares

공개 메소드들

메소드 설명
__construct ( Geocoder $geocoder = null ) Constructor. Set the geocoder instance.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
getLocation ( Psr\Http\Message\ServerRequestInterface $request ) : Geocoder\Model\AddressCollection | null Returns the client location.
saveInSession ( boolean $save = true ) : self Wheter or not save the geolocation in a session variable.

메소드 상세

__construct() 공개 메소드

Constructor. Set the geocoder instance.
public __construct ( Geocoder $geocoder = null )
$geocoder Geocoder\Geocoder

__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

getLocation() 공개 정적인 메소드

Returns the client location.
public static getLocation ( Psr\Http\Message\ServerRequestInterface $request ) : Geocoder\Model\AddressCollection | null
$request Psr\Http\Message\ServerRequestInterface
리턴 Geocoder\Model\AddressCollection | null

saveInSession() 공개 메소드

Wheter or not save the geolocation in a session variable.
public saveInSession ( boolean $save = true ) : self
$save boolean
리턴 self