i recently start using CodeIgniter as PHP MVC FrameWork , before CodeIgniter, i was using my own small implementation of MVC Pattern , So , i was using language system build on constants like :
define( CONTACT_US , ' Contact Us ' );
and so ... , but when i start using CodeIgniter , i see it use Language Class , so if we need to use a language in a view we need first to declare it like $lang['mainpage_contact'] = "Contact Us";
, when we need to pass it to view ,
$this->lang->load('mainpage' );
$date['contact'] = $this->lang->line('mainpage_contact');
and then pass it to view , in the first way , we can just define the constant and load the file , then use it directly in the view ... what is the best way ?