[eluser]Daniel_C[/eluser]
Hello everyone, thanks for the answers.
Well, I'm trying to build my own extended library to auto detect language used by the user.
This is my code:
Code:
<?php
class MY_Language extends CI_Language {
function MY_Language() {
parent::CI_Language();
include_once(APPPATH . 'config/autoload' . EXT);
//detect language using the headers
//...
//
$lang = 'spanish';
$file = $autoload['language'];
if (!is_array($file)) {
$file = array($file);
}
foreach ($file as $langfile) {
$this->load($langfile, $lang);
}
}
}
I did not find the way to read autoload values, so the code include the script, but when I do that and use the db library, it throws me an error.
Controller has this code
Code:
$this->db->select('rg.nombre_corto, rr.nombre');
And when I look at that controller, PHP shows me this error:
Fatal error: Call to a member function select() on a non-object
It's weird because I have database for autoloading in the autoload configuration. When I put a comment in the line of inclusion the database is correctly loading.
Thanks.