Welcome Guest, Not a member yet? Register   Sign In
Slug from database available on all pages through lang CodeIgniter
#3

(This post was last modified: 08-15-2015, 04:36 AM by sebastianvirlan.)

You did not read my problem.

I found one solution:

Created:


PHP Code:
       public function LanguageLoader() {

       $site_lang $this->session->userdata('site_lang');
       if ($site_lang) {
           $this->lang->load('message',$this->session->userdata('site_lang'));
       } else {
$this->lang->load('message'$this->config->item('language'));

       }
   

in MY_Controller.php

and call it in the constructor:
PHP Code:
$this->LanguageLoader(); 


and delete


PHP Code:
   $hook['post_controller_constructor'] = array(
   'class' => 'LanguageLoader',
   'function' => 'initialize',
   'filename' => 'LanguageLoader.php',
   'filepath' => 'hooks'
); 


from hooks.php so now I load the language in controller`s construct not with hook. What can you tell me about this?
Reply


Messages In This Thread
RE: Slug from database available on all pages through lang CodeIgniter - by sebastianvirlan - 08-15-2015, 04:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB