This is a Plugin for the Recess PHP Framework which adds a view helper for JSON Template rendering.
- Recess >= 0.2
- Download this repository to plugins/Jsont
- Modify your Application
- Library::import(‘Jsont.JsontPlugin’);
- $this→plugins = array( new JsontPlugin() );
- That’s it!
post/list.html.jsont
{.section posts} <ul class="posts"> {.repeated section @} <li>{title} by {author}</li> {.end} </ul> {.end}
$posts = $post->all(); echo Jsont::draw('post/list', $posts);
http://json-template.googlecode.com/svn/trunk/doc/Introducing-JSON-Template.html