\rex_csrf_token

Class for generating and validating csrf tokens.

Summary

Methods
Properties
Constants
setFactoryClass()
getFactoryClass()
hasFactoryClass()
factory()
getId()
getValue()
getHiddenField()
getUrlParams()
isValid()
remove()
removeAll()
No public properties found
PARAM
callFactoryClass()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

PARAM

PARAM = '_csrf_token'

Methods

setFactoryClass()

setFactoryClass(string  $subclass) : mixed

Sets the class for the factory.

Parameters

string $subclass

Classname

Throws

\InvalidArgumentException

Returns

mixed —

getFactoryClass()

getFactoryClass() : string

Returns the class for the factory.

Returns

string —

hasFactoryClass()

hasFactoryClass() : bool

Returns if the class has a custom factory class.

Returns

bool —

factory()

factory(string  $tokenId) : static

Parameters

string $tokenId

Returns

static —

getId()

getId() : string

Returns

string —

getValue()

getValue() : string

Returns

string —

getHiddenField()

getHiddenField() : string

Returns

string —

getUrlParams()

getUrlParams() : array

Returns an array containing the `_csrf_token` param.

Returns

array —

isValid()

isValid() : bool

Returns

bool —

remove()

remove() : mixed

Returns

mixed —

removeAll()

removeAll() : mixed

Returns

mixed —

callFactoryClass()

callFactoryClass(string  $method, array  $arguments) : mixed

Calls the factory class with the given method and arguments.

Parameters

string $method

Method name

array $arguments

Array of arguments

Returns

mixed —

Result of the callback