php - How to load languages in CodeIgniter only once per session? -


according i've read loading custom languages in codeigniter, language file must loaded in controller, "passed" view.

here comes performance issue. every time page called, server must load language file. how can language file loaded once? , use along same session?

thanks everyone.

francesco

load language file (e.g. general_lang.php) in constructor of default controller this:

function __construct(){     parent::__construct();     // other stuff ...     $this->lang->load('general', 'english'); } 

the language file called once (whenever call default controller, whenever start new session)


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -