Код: Выделить всё
supersite.local/debug
Код: Выделить всё
api.supersite.local
т.к. сюда они не попадают
Код: Выделить всё
supersite.local/debug
Код: Выделить всё
supersite.local/debug
Код: Выделить всё
api.supersite.local
Код: Выделить всё
supersite.local/debug
Код: Выделить всё
An Error occurred while handling another error:
yii\base\InvalidArgumentException: Response content must not be an array. in ../yii2/web/Response.php:
Код: Выделить всё
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
Дейсвие должно быть такоеan.viktory@gmail.com писал(а): ↑2019.10.10, 12:38 я создал другой контроллер т.к. это был под RestController занят
создал TestController в нем actionTest получаю ответ пустой json ответ
Код: Выделить всё
public function actionTest()
{
Yii::$app->response->format = \yii\web\Response::FORMAT_HTML;
return $this->render('index');
}
Код: Выделить всё
An Error occurred while handling another error:
yii\base\InvalidArgumentException: Response content must not be an array
Код: Выделить всё
'response' => [
'class' => 'common\modules\statistics\components\StatisticsResponse',
'format' => yii\web\Response::FORMAT_JSON, // стандартные ошибки в json (Page Not Found)
'charset' => 'UTF-8',
'on beforeSend' => function ($event) {
$response = $event->sender;
if ($response->data !== null) {
$response->data = [
'success' => $response->isSuccessful,
'data' => $response->data,
];
} else {
$response->statusCode = 200;
}
},
'formatters' => [
'json' => [
'class' => 'yii\web\JsonResponseFormatter',
'prettyPrint' => YII_DEBUG,
'encodeOptions' => JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE,
],
],
],
Рано сдаетесь))an.viktory@gmail.com писал(а): ↑2019.10.10, 13:37 когда закомментировал переопределение Response то получил пустой ответ без дебаг панели. Думаю не стоит дальше пытаться так можно сломать то что есть. Извиняюсь за отнятое время. Думал что все гораздо проще.
Код: Выделить всё
'on beforeSend' => function ($event) {
$response = $event->sender;
if ($response->data !== null && $response->format == \yii\web\Response::FORMAT_JSON) {
$response->data = [
'success' => $response->isSuccessful,
'data' => $response->data,
];
} else {
$response->statusCode = 200;
}
},
Код: Выделить всё
Invalid Argument – yii\base\InvalidArgumentException
The file or directory to be published does not exist: /var/www/supersite.local/vendor/bower/bootstrap/dist
Код: Выделить всё
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
]
Код: Выделить всё
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],