Codeigniter-致命错误:调用未定义的函数lang()

时间:2017-09-06 01:42:16

标签: php codeigniter

我不知道它是什么错误。我在本地运行,它工作正常,但当我尝试在实时服务器上运行时,它给了我这个错误。

致命错误:

  

在第672行的/var/www/html/my_system/application/controllers/usermanagement/usermanagement_main.php中调用未定义的函数lang()

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

1 个答案:

答案 0 :(得分:0)

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

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