Liam Fell
Liam Fell

Reputation: 1320

Issue loading language file, CI

I have extended CI's baked in form validation, however I'm having issues loading a language files. I have the following code:

class MY_Form_validation extends CI_Form_validation {

    public function __construct() {
        parent :: __construct();
        $this->load->lang('raf');

    }

However this throws the error:

Call to a member function lang() on a non-object

Can anyone spot the issue here?

Upvotes: 0

Views: 89

Answers (2)

dreams true
dreams true

Reputation: 90

To load language in codeigniter, Syntax is :

$this->lang->load('filename', 'language');

Not:

$this->load->lang();

Upvotes: 3

Maninderpreet Singh
Maninderpreet Singh

Reputation: 2587

Try after load Helper file

$this->load->helper('language');

Upvotes: 1

Related Questions