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
Post a Comment