JSON Formatters

​The following formatters can be used to control the formatting of data within various contexts.

{variable|json}

Output the variable as JSON.

{variable|json-pretty}

Output the variable as formatted JSON.

{variable|slugify}

Convert a human readable string to a url slug. For instance, "Test Example" would become "test-example".

{variable|url-encode}

Encode a variable so it can be safely used in a URL. For instance, "Test Example" would become "Test%20Example".

{variable|html}

Escape a string to ensure it is valid HTML.

{variable|htmlattr}

Escape a string to ensure it can be used in an attribute reference (src="X", for instance) within an HTML tag.

Make links and @names link to the appropriate places on twitter. For instance, @acasalena (the string) would become @acasalena