So I’m using Codeigniter’s Template Parser Class as my template engine. It’s pretty basic, but it should do what I need. My only beef with it is that it displays the unused pseudo-variables. This is a deal-breaker for me!
Controller
public function index()
{
$this->parser->parse('templates/home', array('foo'=>'bar'));
}
View
{foo}
{hello}
Output
bar {hello}
Does anybody know how I can prevent the unused pseudo-variables from displaying?
CodeIgniter 2.1.2
On a side-note, I’m open to alternatives. I haven’t been able to find a robust template engine for CodeIgniter 2 that wasn’t out-of-date or doesn’t have decent documentation.
I ended up using Phil Sturgeon’s CodeIgniter-Template template library, which, ironically isn’t incredibly better than the template library built into CodeIgniter. However it did solve my immediate problem.
http://getsparks.org/packages/template/show