public function actionMove() { $nId = Yii::app()->request->getParam('id', NULL); $nParentId = Yii::app()->request->getParam('parent', NULL); $nOldParentId = Yii::app()->request->getParam('oldParent', NULL); $nPosition = Yii::app()->request->getParam('position', NULL); $nOldPosition = Yii::app()->request->getParam('oldPosition', NULL); if (Item::treeMove($nId, $nParentId, $nOldParentId, $nPosition, $nOldPosition)) { $this->jsonOutput(['status' => 'ok']); } $this->jsonOutput(['message' => 'Cannot move item.'], 'error'); }