Codeigniter - 无法调用系统的lang()函数

时间:2011-04-19 12:04:19

标签: php codeigniter

尝试调用lang()函数,该函数是codeigniter的系统/帮助程序(language_helper.php)的一部分,导致致命错误

Fatal error: Call to undefined function lang()

$def_actions['add'] = array('name' => lang('carbogrid_add'), 'alias' => 'add', 'url' => $this->add, 'icon' => 'ui-icon-circle-plus', 'toolbar' => TRUE, 'grid' => FALSE);

1 个答案:

答案 0 :(得分:12)

在执行此操作之前,您必须加载帮助程序:

$this->load->helper('language');

$def_actions['add'] = array('name' => lang('carbogrid_add'), 'alias' => 'add', 'url' => $this->add, 'icon' => 'ui-icon-circle-plus', 'toolbar' => TRUE, 'grid' => FALSE);