Class kartik\tree\TreeSecurity
Inheritance | kartik\tree\TreeSecurity |
---|---|
Available since version | 1.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
Method | Description | Defined 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
Method | Description | Defined By |
---|---|---|
getParsedData() | Gets parsed output and hash data for a tree action data source | kartik\tree\TreeSecurity |
Method Details
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 |
Gets the model class name key from the data array
public static mixed getModelClass ( $data = [] ) | ||
$data | array |
Gets the node singular and plural titles
public static array getNodeTitles ( $data ) | ||
$data | array | The source data |
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 |
Parses tree manage data and returns processed manage data signatures for the tree
public static array parseManageData ( $data = [] ) | ||
$data | array | |
throws | yii\base\InvalidConfigException |
---|
Parses tree move data and returns processed move data signatures for the tree
public static array parseMoveData ( $data = [] ) | ||
$data | array | |
throws | yii\base\InvalidConfigException |
---|
Parses tree remove data and returns processed remove data signatures for the tree
public static array parseRemoveData ( $data = [] ) | ||
$data | array | |
throws | yii\base\InvalidConfigException |
---|