[ 'class' => CloudBehavior::className(), ], ]); } public function actionIndex() { if (\Yii::$app->request->isAjax) { try { return CloudPlugin::getList(); } catch (\Exception $e) { return [ 'code' => 1, 'msg' => $e->getMessage(), ]; } } else { return $this->render('index'); } } public function actionDetail() { if (\Yii::$app->request->isAjax) { try { return CloudPlugin::getDetail(\Yii::$app->request->get('id')); } catch (\Exception $e) { return [ 'code' => 1, 'msg' => $e->getMessage(), ]; } } else { return $this->render('detail'); } } public function actionCreateOrder() { if (\Yii::$app->request->isPost) { try { return CloudPlugin::createOrder(\Yii::$app->request->post('id')); } catch (\Exception $e) { return [ 'code' => 1, 'msg' => $e->getMessage(), ]; } } } public function actionInstall($id) { try { return CloudPlugin::install($id); } catch (\Exception $e) { return [ 'code' => 1, 'msg' => $e->getMessage(), ]; } } }