PHP 클래스 Contao\RequestToken

The class tries to read and validate the request token from the user session and creates a new token if there is none. Usage: echo RequestToken::get(); if (!RequestToken::validate('TOKEN')) { throw new Exception("Invalid request token"); }
상속: extends System
파일 보기 프로젝트 열기: contao/core-bundle 1 사용 예제들

공개 메소드들

메소드 설명
get ( ) : string Return the token
initialize ( ) Read the token from the session or generate a new one
validate ( string $strToken ) : boolean Validate a token

메소드 상세

get() 공개 정적인 메소드

Return the token
public static get ( ) : string
리턴 string The request token

initialize() 공개 정적인 메소드

Read the token from the session or generate a new one
public static initialize ( )

validate() 공개 정적인 메소드

Validate a token
public static validate ( string $strToken ) : boolean
$strToken string The request token
리턴 boolean True if the token matches the stored one