indent

Summary

Returns an indented version of the input string.

Usage

input|indent( count [, type [, filler ] ] )

Parameters

NameTypeDescriptionRequired
count integer Number of indentations. Yes.
type string Type of indentation ("space", "tab" or "custom"). No.
filler string Custom indentation. No.

Returns

An indented version of the input string.

Description

This operator indents the input string and returns it. The indentation type can be set to "space", "tab" or "custom". The default indentation is "space". If the indentation type is set to "custom", the "filler" parameter must be set to the desired indentation string.

Examples

Example 1

{'This is my text'|indent( 1 )}

The following string will be returned: " This is my text".

Example 2

{'This is my second line'|indent( 3, 'custom', '.' )}

The following string will be returned: "...This is my second line".

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.