views:

98

answers:

2

I have an iPhone application which needs to generate a local HTML file from a template and then render the HTML in a UIWebView. It basically needs simple Django-like template features, just to replace template tags with values and simple enumeration over collections (for instance to generate rows of a table). Is there some existing simple template framework available for iPhone apps (implemented in C or in Objective-C of course)? I looked at Dashcode but that does not fit my needs I dont think. I have an HTML file I just want to replace values in it and enumerate/loop over collections to do it. I cant use Javascript for this actually because HTML needs to be email-able.

Thanks.

A: 

I've written a simple tempalte class once. It had <%= foobar %> style tags in it. I would call [myTemplate setValue:@"I like SO" forVar:@"foobar"] which would find the tag and replace it.

Looping and enumeration might be much harder. Maybe there is a ObjC templating library out there that I don't know of.

Squeegy
A: 

Take a look at MGTemplateEngine

Alex Deem