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
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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