CodeIgniter Forums
Using { } notation in CodeIgniter? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Using { } notation in CodeIgniter? (/thread-11796.html)



Using { } notation in CodeIgniter? - El Forum - 09-23-2008

[eluser]Unknown[/eluser]
Hi all,

I'm fairly new to CodeIgniter and way more familiar with standard PHP.

We are building language files to translate our website into various languages and enumerating the variables in the standard way $lang['this_text'] = "This English Text";

My lead developer told me I could use {this_text} to echo out the variable's contents in CodeIgniter but it is not working, it is simply printing out {this_text} as text.

Anyone know what I need to do here?

Thanks.


Using { } notation in CodeIgniter? - El Forum - 09-23-2008

[eluser]opel[/eluser]
if you use colin williams "Template" library or smarty to handle your views I think you can do that. Not used smarty, also may be possible in standard CI, but in colins you put this in your controller:

$data['title'] = 'Title Goes Here';

$this->template->parse_view('your_view', $data);

then in the view

<h1>{title}</h1> or <h1>{$title}</h1>


Using { } notation in CodeIgniter? - El Forum - 09-23-2008

[eluser]Derek Allard[/eluser]
Sounds like they were referring to the Template Parser Class.

Welcome to CodeIgniter!