header_list = self::$default_header_list; $this->fzmCrossHeader(); } } public function fzmCrossHeader() { $this->lang = \Yii::$app->request->headers->get('lang') ?? 'zh-CN'; if ('en' == strtolower($this->lang)) { $this->lang = 'en-US'; } } /** * @param $action * @return bool * @throws \yii\web\BadRequestHttpException */ public function beforeAction($action) { $this->start = microtime(true); return parent::beforeAction($action); } /** * @param \yii\base\Action $action * @param mixed $result * @return mixed */ public function afterAction($action, $result) { $this->end = microtime(true); return parent::afterAction($action, $result); } }