Codeigniter language

# Languages

languages/en/site_lang.php

$lang['site_title'] = "English Title";

languages/th/site_lang.php

$lang['site_title'] = "ไทย หัวข้อ";

# Controller

// Load the language helper to get lang() method in view
$this->load->helper('language');

// Change the 'en' key to 'ml' for change the language
$this->lang->load("site", 'en'); </code></pre>

# View

// This will echo 'English Title'
<?php echo lang('site_title'); ?>

Related posts:

This entry was posted in codeigniter. Bookmark the permalink.