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