gk1
gk1

Reputation: 149

Codeigniter - Unable to call system's lang() function

Trying to call lang() function that is part of codeigniter's system/helpers (language_helper.php), resulting in a Fatal error

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);

Upvotes: 3

Views: 8003

Answers (1)

Karl Laurentius Roos
Karl Laurentius Roos

Reputation: 4399

You have to load the helper before doing that:

$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);

Upvotes: 12

Related Questions