Class kartik\tree\controllers\NodeController

Inheritancekartik\tree\controllers\NodeController » yii\web\Controller

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$boolKeys array The list of keys in $_POST which must be cast as boolean kartik\tree\controllers\NodeController

Public Methods

Hide inherited methods

MethodDescriptionDefined By
actionManage() View, create, or update a tree node via ajax kartik\tree\controllers\NodeController
actionMove() Move a tree node kartik\tree\controllers\NodeController
actionRemove() Remove a tree node kartik\tree\controllers\NodeController
actionSave() Saves a node once form is submitted kartik\tree\controllers\NodeController
process() Processes a code block and catches exceptions kartik\tree\controllers\NodeController

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
checkValidRequest() Checks if request is valid and throws exception if invalid condition is true kartik\tree\controllers\NodeController
getPostData() Gets the data from $_POST after parsing boolean values kartik\tree\controllers\NodeController

Property Details

$boolKeys public static property

The list of keys in $_POST which must be cast as boolean

public static array $boolKeys = ['isAdmin''softDelete''showFormButtons''showIDAttribute''multiple''treeNodeModify''allowNewRoots']

Method Details

actionManage() public method

View, create, or update a tree node via ajax

public string actionManage ( )
return string

Json encoded response

actionMove() public method

Move a tree node

public void actionMove ( )
actionRemove() public method

Remove a tree node

public void actionRemove ( )
actionSave() public method

Saves a node once form is submitted

public void actionSave ( )
checkValidRequest() protected static method

Checks if request is valid and throws exception if invalid condition is true

protected static void checkValidRequest ( $isInvalid null )
$isInvalid bool

Whether the request is invalid

throws \yii\base\InvalidCallException
getPostData() protected static method

Gets the data from $_POST after parsing boolean values

protected static array getPostData ( )
process() public static method

Processes a code block and catches exceptions

public static array process ( $callback, $msgError, $msgSuccess )
$callback \kartik\tree\controllers\Closure

The function to execute (this returns a valid $success)

$msgError string

The default error message to return

$msgSuccess string

The default success error message to return

return array

Outcome of the code consisting of following keys:

  • 'out': string, the output content
  • 'status': string, success or error