public function actionRemove() { $nId = Yii::app()->request->getParam('id', NULL); if (Item::treeRemove($nId)) { $this->jsonOutput(['status' => 'ok']); } $this->jsonOutput(['message' => 'Cannot remove item.'], 'error'); }