Skip to content

Kirby 5.1.1

$field->short()

Cuts the string after the given length and adds "…" if it is longer

$field->short(int $length, string $appendix = '…'): Kirby\Content\Field

Parameters

Name Type Default Description
$lengthrequired int no default value The number of characters in the string
$appendix string '…' An optional replacement for the missing rest

Return type

Kirby\Content\Field

This method modifies the existing $field object it is applied to and returns it again.

Examples

<?= $page->title()->short(10) ?>