0
我跟着這個教程:http://codeigniter.com/wiki/Internationalization_and_the_Template_Parser_Class/如何從視圖文件(html)更改控制器內的變量的值?
加載的語言控制器是這一個:
<?php
class Example extends Controller {
function Example() {
parent::Controller();
# Load libraries
$this->load->library('parser');
# Load language
$this->lang->load('example', 'english');
}
function index() {
# Load variables into the template parser
$data = $this->lang->language;
# Display view
$this->parser->parse('example', $data);
}
}
?>
爲了改變我必須手動更改english
說在控制器spanish
的語言。
用戶可以通過index.php文件(視圖)執行此操作的最佳方式是什麼?
對不起,我是初學者。你能給我一個index.php文件代碼的例子嗎? (用戶點擊鏈接更改語言)。 – alexchenco 2010-05-13 20:10:54