Inherits from NSObject
Conforms to GRMustacheFilter
Declared in GRMustacheFilter.h

Overview

The GRMustacheFilter class helps building mustache filters without writing a custom class that conforms to the GRMustacheFilter protocol.

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

Class Methods

filterWithBlock:

Returns a GRMustacheFilter object that executes the provided block when tranforming a value.

+ (id<GRMustacheFilter>)filterWithBlock:(id ( ^ ) ( id value ))block

Parameters

block

The block that transforms its input.

Return Value

a GRMustacheFilter object.

Availability

v4.3

Declared In

GRMustacheFilter.h

variadicFilterWithBlock:

Returns a GRMustacheFilter object that executes the provided block, given an array of arguments.

+ (id<GRMustacheFilter>)variadicFilterWithBlock:(id ( ^ ) ( NSArray *arguments ))block

Parameters

block

The block that transforms its input.

Return Value

a GRMustacheFilter object.

Availability

v5.5

Discussion

Those filters can evaluate expressions like {{ f(a,b) }}.

GRMustache will invoke the filter regardless of the number of arguments in the template: {{ f(a) }}, {{ f(a,b) }} and {{ f(a,b,c) }} will provide arrays of 1, 2, and 3 arguments respectively. It is your responsability to check that you are provided with as many arguments as you expect.

Declared In

GRMustacheFilter.h