我有一個控制器加載一個語言文件,但該語言文件只適用於我加載文件的功能。我如何使所有功能都可用,而不必在所有功能中執行$this->lang->load('main');
?如何爲所有功能提供語言文件? - codeigniter
我的控制器:
class Main extends CI_Controller{
function _construct(){
parent::__construct();
//$this->lang->load('main'); //already tryed here doesn't load
}
function index(){
//$this->lang->load('main'); //if i do it here it's not available for the other functions
}
function homeL(){
}
function homeR(){
}
function messagesL(){
}
function messagesR(){
}
}
如何在某些視圖中從lang文件打印某些內容?它不適合我... – zesilva 2012-03-12 00:41:46
我使用echo $ this-> lang-> line('key'); – 2012-03-13 01:53:18
這隻適用於如果我加載語言文件在加載我想打印內容的視圖的特定功能。 – zesilva 2012-03-13 14:46:17