_status = new ActionStatus(); yii::$app->language = LanguageHelper::getLanguage(); parent::init(); } /** * Reads data posted from client as "application/json" * * @throws \Exception * @return bool|mixed|string */ public static function getInputJson() { try { $input = Yii::$app->request->getRawBody(); return json_decode($input, true); } catch (\Exception $e) { return false; } } public static function getRequestGetParams() { $request = Yii::$app->request; if (!$request->isGet) { //return false; //todo implemet GET requests on frontend return self::getInputJson(); //DEPRECATED!!! POST hack } return $request->getBodyParams(); } public function baseVerifyAjaxRequest() { /*if (!isset($_POST['redirect']) && !\Yii::$app->request->isAjax) throw new HttpException('400', \Yii::t('api','Bad Request'));*/ } public function answer() { return $this->_status; } }