runWithParams() public méthode

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.
Résultat mixed the result of the action
Exemple #1
0
 /**
  * @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());
 }