Home  >  Article  >  PHP Framework  >  Where to set language in yii

Where to set language in yii

尚
Original
2020-03-11 14:23:072478browse

Where to set language in yii

How to set the language in yii:

Method 1: Comment out the following code in app\web\index.php:

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

Add The following code:

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

Method 2: Set in app\config\web.php:

$config = [
....
    'language'=>'zh_CN',
    'id' => 'basic',
...
]

Related tutorial recommendations: yii framework

The above is the detailed content of Where to set language in yii. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn