php – how to use language file in codeigniter 404 file-ThrowExceptions

Exception or error:

I’m trying to change the CodeIgniter’s error 404 view file using my own design and I thought might as well translate some of the words in it. but I got an error Message: Undefined property: CI_Exceptions::$lang when I’m using this code to load the language file inside the view file:

$lang = [
    'msg' => $this->lang->load('custom_msg_lang', $this->session->language, true),
];

I tried using this kind of code in other places and it works normally. what am I doing wrong?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *