CI多语言文件设置
首先在language文件夹中加入语言文件夹
例如:中英文
![在这里插入图片描述](https://img-blog.csdnimg.cn/20190813105500552.png)
- 在base_lang.php内部写相应的文字,下面为中文和英文相应文件例子
<?php
$lang = array(
'title' =>'钛合影业,下一届奥斯卡最佳导演奖就是你',
'title_p' => '专业的团队打造一流的拍摄水平,让你的剧本更专业',
);
<?php
$lang = array(
'title' => 'Titanium photo industry, the next Oscar best director award is you',
'title_p' => 'Professional team to create first-class shooting level, let your script more professional',
);
- 其次在如下文件下内加入以下代码
$autoload['libraries'] = array('layout','database', 'GetInput');
$autoload['helper'] = array('url', 'language');
- 在config.php内设置初始语言
$config['language'] = 'english';
- 在需要语言转换的地方加上
<?=lang('title')?>