Class kartik\tree\TreeSecurity

Inheritancekartik\tree\TreeSecurity
Available since version1.0

Tree data security and data hashing helper class. This class and its methods are used by the kartik\tree\TreeView widget to manage data transfer between the client and the server in a secure way.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
checkSignature() Checks signature of posted data for ensuring security against data tampering. kartik\tree\TreeSecurity
getModelClass() Gets the model class name key from the data array kartik\tree\TreeSecurity
getNodeTitles() Gets the node singular and plural titles kartik\tree\TreeSecurity
parseManageData() Parses tree manage data and returns processed manage data signatures for the tree kartik\tree\TreeSecurity
parseMoveData() Parses tree move data and returns processed move data signatures for the tree kartik\tree\TreeSecurity
parseRemoveData() Parses tree remove data and returns processed remove data signatures for the tree kartik\tree\TreeSecurity

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getParsedData() Gets parsed output and hash data for a tree action data source kartik\tree\TreeSecurity

Method Details

checkSignature() public static method

Checks signature of posted data for ensuring security against data tampering.

public static void checkSignature ( $action, $oldHash '', $newHash null )
$action string

The name of the action

$oldHash string

The old hashed data

$newHash string

The new hashed data

throws yii\base\InvalidCallException
throws yii\base\InvalidConfigException
getModelClass() public static method

Gets the model class name key from the data array

public static mixed getModelClass ( $data = [] )
$data array
getNodeTitles() public static method

Gets the node singular and plural titles

public static array getNodeTitles ( $data )
$data array

The source data

getParsedData() protected static method

Gets parsed output and hash data for a tree action data source

protected static array getParsedData ( $defaults, $data, $callback null )
$defaults array

The default data

$data array

The source data

$callback Closure|null

The callback to process specific data keys

return array

The parsed data

throws yii\base\InvalidConfigException
parseManageData() public static method

Parses tree manage data and returns processed manage data signatures for the tree

public static array parseManageData ( $data = [] )
$data array
throws yii\base\InvalidConfigException
parseMoveData() public static method

Parses tree move data and returns processed move data signatures for the tree

public static array parseMoveData ( $data = [] )
$data array
throws yii\base\InvalidConfigException
parseRemoveData() public static method

Parses tree remove data and returns processed remove data signatures for the tree

public static array parseRemoveData ( $data = [] )
$data array
throws yii\base\InvalidConfigException