diff --git a/Action.php b/Action.php index 21ed1f3..3dc3094 100644 --- a/Action.php +++ b/Action.php @@ -29,7 +29,7 @@ public function run() } Yii::endProfile('service.request'); - Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; + //Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; return $this->toJson(); } diff --git a/traits/Request.php b/traits/Request.php index 485cc5c..6d1dbad 100644 --- a/traits/Request.php +++ b/traits/Request.php @@ -17,6 +17,9 @@ public function getParams($method) { $params = []; $args = isset($this->_data['params']) ? $this->_data['params'] : []; + + if(isset($args[0]) && is_array($args[0])) $args = $args[0]; + foreach ($method->getParameters() as $param) { /* @var $param ReflectionParameter */ if (isset($args[$param->getName()])) {