Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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);
like image 330
gk1 Avatar asked Feb 04 '26 02:02

gk1


1 Answers

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);
like image 55
Karl Laurentius Roos Avatar answered Feb 06 '26 15:02

Karl Laurentius Roos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!