Commit 5d981bc1 authored by shajiaiming's avatar shajiaiming

add request header

parent 835f3927
......@@ -15,6 +15,24 @@ class BaseController extends Controller
public $start;
public $end;
public $header_list = [];
public $lang;
private static $default_header_list = [];
public function init()
{
if ('cli' !== php_sapi_name()){
$this->header_list = self::$default_header_list;
$this->fzmCrossHeader();
}
}
public function fzmCrossHeader()
{
$this->lang = \Yii::$app->request->headers->get('lang') ?? 'zh';
}
public function beforeAction($action)
{
$this->start = microtime(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment