1

How can I access my lang variables in controller?

function index()  
{   
    $seo_title = $this->lang->line('blablabla');
    $data['page_title'] =  $seo_title;  
    $this->load->view('contact/index.php',$data);  
}

in my lang file blablabla has string in, and it works well when I call from view file. but when I want to call from controller, it doesnt return anything :(

any idea about problem? appreciate!!

1 Answer 1

4

You need to load the language file you want to use before you grab lines from it:

$this->lang->load('filename', 'language');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.