class Marten::Template::Filter::Truncate

Overview

The truncate filter.

The truncate filter truncates a string to the given number of characters. Truncated strings end with an ellipsis ("...") that is accounted for in the resulting size. A filter argument corresponding to the maximum size is mandatory.

{{ value|truncate:15 }}

Defined in:

marten/template/filter/truncate.cr

Instance Method Summary

Instance methods inherited from class Marten::Template::Filter::Base

apply(value : Value, arg : Value | Nil = nil) : Value apply

Instance Method Detail

def apply(value : Value, arg : Value | Nil = nil) : Value #

[View source]