If a request is sent via Accept: application/json; version=v1,
After content negotiation, yii\web\Response::$acceptParams
will contain the value ['version' = > 'v1'].
But it is empty after printing. What is the reason?
var_dump((new Response())->acceptParams);
人生最曼妙的風(fēng)景,竟是內(nèi)心的淡定與從容!
var_dump(Yii::$app->response->acceptParams["sub-version"]);
就可以了,被手冊誤導(dǎo)了