/** * @inheritdoc */ public function init() { parent::init(); if ($this->modelClass === null) { throw new InvalidConfigException('The "modelClass" property must be set.'); } }
public function init() { parent::init(); $request = wanhunet::$app->request; if (!$request->isGet) { $params = json_decode(file_get_contents('php://input'), true); $request->setBodyParams($params); } }
/** * @throws \yii\web\HttpException */ public function init() { if ($this->modelClass === null) { throw new InvalidConfigException(get_class($this) . '::$modelClass must be set.'); } if ($this->searchFormClass === null) { throw new InvalidConfigException(get_class($this) . '::$searchFormClass must be set.'); } parent::init(); }
/** * @inheritdoc */ public function init() { parent::init(); if (isset($_GET['type']) && ($typeItem = Yii::$app->collectors['types']->getOne($_GET['type'])) && ($type = $typeItem->object) && !empty($type) && $type->enableApiAccess) { $this->modelClass = $type->primaryModel; } if ($this->modelClass === null) { throw new ForbiddenHttpException('Unable to access the object type \'' . (isset($_GET['type']) ? $_GET['type'] : 'unknown') . '\'.'); } }
public function init() { parent::init(); \Yii::$app->user->enableSession = false; \Yii::$app->user->loginUrl = null; \Yii::$app->response->on('beforeSend', function ($event) { $response = $event->sender; if ($response->data !== null and !$response->isSuccessful) { $response->data = ['status' => $response->statusCode, 'message' => $response->statusText, 'success' => (int) $response->isSuccessful, 'data' => $response->data]; } }); }
public function init() { parent::init(); Yii::$app->response->format = Response::FORMAT_JSON; }
public function init(){ $this->_startTime = microtime(true); parent::init(); }
public function init() { parent::init(); }
/** * @inheritdoc */ public function init() { $this->basket = $this->module->basket; parent::init(); }