Conforms to NSObject
Declared in GRMustacheRendering.h

Overview

The protocol for your own objects that perform custom rendering.

Companion guide: https://github.com/groue/GRMustache/blob/master/Guides/rendering_objects.md

Instance Methods

renderForMustacheTag:context:HTMLSafe:error:

This method is invoked when the receiver should be rendered by a Mustache tag.

- (NSString *)renderForMustacheTag:(GRMustacheTag *)tag context:(GRMustacheContext *)context HTMLSafe:(BOOL *)HTMLSafe error:(NSError **)error

Parameters

tag

The tag to be rendered

context

A context for rendering inner tags.

HTMLSafe

Upon return contains YES if the result is HTML-safe.

error

If there is an error performing the rendering, upon return contains an NSError object that describes the problem.

Return Value

The rendering of the receiver for the given tag, in the given context.

Availability

v6.0

Discussion

It returns three values: the rendering itself, a boolean that says whether the rendering is HTML-safe or not, and an eventual error.

Input values are the tag that should be rendered, and the context object that represents the current context stack.

Depending on the content type of the currently rendered template, an output parameter HTMLSafe set to NO will have the returned string HTML-escaped.

Declared In

GRMustacheRendering.h