module Crinja::Filter

Overview

Variables can be modified by filters. Filters are separated from the variable by a pipe symbol (|) and may have optional arguments in parentheses. Multiple filters can be chained. The output of one filter is applied to the next.

For example, {{ name|striptags|title }} will remove all HTML Tags from variable name and title-case the output (similar to title(striptags(name))).

Filters that accept arguments have parentheses around the arguments, just like a function call.

For example: {{ listx|join(', ') }} will join a list with commas (list.join(", ")).

Builtin Filters

The following filters are available in the default library:

Defined in:

lib/filter.cr
lib/filter/collections.cr
lib/filter/escape.cr
lib/filter/html.cr
lib/filter/join.cr
lib/filter/liquid.cr
lib/filter/number.cr
lib/filter/sort.cr
lib/filter/string.cr
lib/filter/var.cr