Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的一个配置文件中,我想访问语言行项目。我怎样才能做到这一点?我尝试获取一个 CI 实例并以这种方式访问它(例如$CI->lang->line('foo')),但这不起作用。建议?
$CI->lang->line('foo')
制作pre_controller将在每个请求中设置配置项的钩子。
pre_controller
$CI = &get_instance(); $CI->lang->load('filename'); $CI->config->set_item('item_name', $CI->lang->line('language_key'));
或类似的东西。