CodeIgniter Forums

Full Version: Using { } notation in CodeIgniter?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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.

El Forum

[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>

El Forum

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

Welcome to CodeIgniter!