Placeholders in language lines - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Placeholders in language lines (/showthread.php?tid=70858) |
Placeholders in language lines - glorsh66 - 06-10-2018 How to use placeholders in $this->lang->line('misc_key', FALSE); It is used in standard libraries (e.g. from validation), but how to use it in my own libs and models? Code: echo sprintf($this->lang->line('somekey'),'XYZ');//load language library before use RE: Placeholders in language lines - InsiteFX - 06-10-2018 Maybe this will help, you can use it in any library Class. PHP Code: // Your lang file - Created under language folder language-name When working outside of a controller you need to get the CodeIgniter Super Object. Also SEE: The CodeIgniter Documentation on Language files etc; |