Home> PHP Framework> YII> body text

Where to set language in yii

Release: 2020-03-11 14:23:07
Original
2444 people have browsed it

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();
Copy after login

Add The following code:

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

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

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

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!

Related labels:
yii
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!