首页 > 代码库 > [moka学习笔记]yii2设置语言和时区

[moka学习笔记]yii2设置语言和时区

1.在web/index.php中

(new yii\web\Application($config))->run();

    1. $app = new \yii\web\Application($config);  
    2. $app->language = "zh-CN";//设置中国区的语言  
    3. $app->run();  
    4. //(new yii\web\Application($config))->run();

 2.app\config\web.php中

$config = [    ‘id‘ => ‘basic‘,    ‘basePath‘ => dirname(__DIR__),    ‘bootstrap‘ => [‘log‘],    ‘defaultRoute‘ => ‘organization-manage/work-discuss/index‘,    ‘layout‘ => ‘main‘,    ‘language‘=>‘zh-CN‘,    ‘timeZone‘=>‘Asia/Shanghai‘,

 

[moka学习笔记]yii2设置语言和时区