0
点赞
收藏
分享

微信扫一扫

tp6加载多语言包


像fastadmin一样,把文件放在对应的

use think\facade\Request;
use think\facade\Cookie;
use think\facade\Lang;

$this->request =Request::instance();  
//模块
$module=app('http')->getName();
//控制器下
$controllername= $this->request->controller();
//加载语言包
Lang::load(root_path() .'/app/' . $module. '/lang/' .Lang::getLangSet() . '/' . str_replace('.', '/', $controllername) . '.php');
//解析语言
var_dump(__("Keep login"));die;


举报

相关推荐

0 条评论