0

I don't know what error is it. I run on local and it is working fine, but when I try to run on the live server it gave me this error.

Fatal error:

Call to undefined function lang() in /var/www/html/my_system/application/controllers/usermanagement/usermanagement_main.php on line 672

$this->load->model('user/user','user');
$this->load->model('tablecode/code_academic_qualifications');
$this->load->model('tablecode/code_certifications');

//Initialize content
//$content['pagetitle'] = lang('eqb_title_userregistration');
$content['userid'] = $userid;
$content['pagefunction'] = lang('eqb_title_edituserprofile'); //<-- line 672
$content['nav'] = lang('eqb_title_userregistration');
$content['updating_user'] = TRUE;
$content['display_form_as'] = 'editing';

$tabletypearray = array('code_city','code_country','code_disability','code_gender','code_marital_status','code_postcode','code_race','code_religion','code_state');
$content['basicfields'] = $this->user->get_all_basic_form_data($tabletypearray);

$content['current_acl_user'] = $this->ezrbac->getCurrentUser();

$content['user_profile_information'] = $this->user->get_complete_user_profile_information_byid($userid);

$acad_data = $this->user->get_user_academic_profile($userid);
Community
  • 1
  • 1
  • The function `lang()` is undefined, its right there in the error message. Probably not being included / you're missing files on your live server. – Enstage Sep 06 '17 at 01:48
  • You can refer to this link for the similar case as your. [Fatal error](https://stackoverflow.com/questions/24032997/fatal-error-call-to-undefined-function-lang-in-ci-merchant-using-cardsave) – Dn91 Sep 06 '17 at 01:51
  • 1
    `lang` is not a function, if you're using language you must you `$this->lang->line('eqb_title_edituserprofile')` – Abdulla Nilam Sep 06 '17 at 01:51
  • Here is the doc on it https://www.codeigniter.com/user_guide/libraries/language.html#loading-a-language-file –  Sep 06 '17 at 02:08
  • https://stackoverflow.com/questions/5716050/codeigniter-unable-to-call-systems-lang-function Refer to this question. I think it might solve your problem. – Prakhar Sood Sep 06 '17 at 05:25
  • Thanks for all of ur idea. I will check it back later – Muhammad Rezuan Sep 06 '17 at 07:24

1 Answers1

2

You have to load the helper before doing that:

$this->load->model('user/user','user');
$this->load->model('tablecode/code_academic_qualifications');
$this->load->model('tablecode/code_certifications');

$this->load->helper('language'); // You have to load the helper before doing that:

//Initialize content
//$content['pagetitle'] = lang('eqb_title_userregistration');
$content['userid'] = $userid;
$content['pagefunction'] = lang('eqb_title_edituserprofile'); //<-- line 672
$content['nav'] = lang('eqb_title_userregistration');
$content['updating_user'] = TRUE;
$content['display_form_as'] = 'editing';

$tabletypearray = array('code_city','code_country','code_disability','code_gender','code_marital_status','code_postcode','code_race','code_religion','code_state');
$content['basicfields'] = $this->user->get_all_basic_form_data($tabletypearray);

$content['current_acl_user'] = $this->ezrbac->getCurrentUser();

$content['user_profile_information'] = $this->user->get_complete_user_profile_information_byid($userid);

$acad_data = $this->user->get_user_academic_profile($userid);
always-a-learner
  • 3,671
  • 10
  • 41
  • 81