Is there a way to create a library that inherits from a FUEL library? For instance, I'm running FUEL 1.0 and am trying to implement the language functionality but noticed that the FUEL language library is only working in the "auto" mode -- query string is being ignored for some reason -- and it's grabbing the default option and not even looking at the User Agent or Cookie values in the detect() function. Basically, I was thinking I could inherit the Fuel_language.php file and modify the detect functionality. Is that even possible?
Comments
$this->load->library('MY_fuel_language', array(), 'fuel_langauge');
The Fuel_language class actually gets loaded on the $CI object as $CI->fuel_language. $CI->fuel->language is just an alias so the above would essentially overwrite it.
To better address your probably, have you update to the latest version and/or looked at all the configuration parameters you can overwitein your fuel/application/config/MY_fuel.php file:
// Languages for pages. The key is saved to the page variables $config['languages'] = array( 'english' => 'English' ); // Specifies the method in which to look for pages with different languages. // Values can be "domain", "segment", "query_string" or "both" (which means both "segment" and "query_string") $config['language_mode'] = 'domain'; // Append the current language value to the site URL automatically $config['add_language_to_site_url'] = FALSE; // force the default language segment, or query string on any URLs created with site_url $config['language_force_default_to_site_url'] = FALSE; // The name of the query string parameter to use for setting the language $config['language_query_str_param'] = 'lang'; // The name of the cookie to hold the currently selected language. One will be generated if left blank $config['language_cookie_name'] = ''; // Default is 2 years $config['language_cookie_exp'] = '63072000'; // Use cookies to remember a selected language $config['language_use_cookies'] = TRUE; // Will check the user agent during language detection $config['language_detect_user_agent'] = ''; // The default language to use $config['language_default_option'] = NULL;
For your suggestion on creating an extended library, where would you suggest I put that load call?