• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using { } notation in CodeIgniter?

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?


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>

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

Welcome to CodeIgniter!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.