Welcome Guest, Not a member yet? Register   Sign In
Using { } notation in CodeIgniter?
#1

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

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

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

Welcome to CodeIgniter!




Theme © iAndrew 2016 - Forum software by © MyBB