CodeIgniter Forums
Correct Way Of Getting Language Text - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Correct Way Of Getting Language Text (/showthread.php?tid=59484)



Correct Way Of Getting Language Text - El Forum - 10-11-2013

[eluser]razerone[/eluser]
Hello. I am just stuck a little bit have be trying to under stand the language setup.

I am trying to see if this is correct way?

In my Language / English folder I have folder called common in that is file called header.php

I am not to sure if this is the correct way of putting the data on there.

Code:
<?php
// Text
$_['text_home']           = 'Home';
$_['text_search']         = 'Search';
?>

And on the controller folder common / header.php

Code:
$this->language->load('common/header');
$this->data['text_home'] = $this->language->get('text_home');
$this->data['text_search'] = $this->language->get('text_search');
$this->data['home'] = $this->url->link('common/home');

And on the views common / header.php

example:
Code:
<div class="links"><a href="&lt;?php echo $home; ?&gt;">&lt;?php echo $text_home; ?&gt;</a></div>

What is wrong not sure I tried it.