This method is mainly invoked by the controller.
public runWithParams ( array $params ) : mixed | ||
$params | array | the parameters to be bound to the action's run() method. |
Результат | mixed | the result of the action |
/** * @inheritdoc * * @param array $params * @return mixed|\yii\web\Response * @throws Exception * @throws \yii\base\InvalidConfigException */ public function runWithParams($params) { if (!$this->createModel()) { return parent::runWithParams($params); } if ($this->loadAndValidateRequest()) { return parent::runWithParams($params); } return Response::fail(400, $this->model->getErrors()); }