PHP Manual

PEAR Manual

Smarty Manual

PostgreSQL

MySQL Manual

Perl Manual

{textformat}

{textformat} is a block function used to format text. it basically cleans up spaces and special characters, and formats paragraphs by wrapping at a boundary and indenting lines.

you can set the parameters explicitly, or use a preset style. currently "email" is the only available style.

attribute nametyperequireddefaultdescription
stylestringnon/apreset style
indentnumberno0the number of chars to indent every line
indent_firstnumberno0the number of chars to indent the first line
indent_charstringno(single space)the character (or string of chars) to indent with
wrapnumberno80how many characters to wrap each line to
wrap_charstringno\nthe character (or string of chars) to break each line with
wrap_cutbooleannofalseif true, wrap will break the line at the exact character instead of at a word boundary
assignstringnon/athe template variable the output will be assigned to

example 8-23. {textformat}

{textformat wrap=40}     this is foo.    this is foo.    this is foo.    this is foo.    this is foo.    this is foo.     this is bar.     bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.     {/textformat}

the above example will output:

this is foo. this is foo. this is foo.    this is foo. this is foo. this is foo.     this is bar.     bar foo bar foo foo. bar foo bar foo    foo. bar foo bar foo foo. bar foo bar    foo foo. bar foo bar foo foo. bar foo    bar foo foo. bar foo bar foo foo.
{textformat wrap=40 indent=4}     this is foo.    this is foo.    this is foo.    this is foo.    this is foo.    this is foo.     this is bar.     bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.     {/textformat}

the above example will output:

this is foo. this is foo. this is    foo. this is foo. this is foo. this    is foo.     this is bar.     bar foo bar foo foo. bar foo bar foo    foo. bar foo bar foo foo. bar foo    bar foo foo. bar foo bar foo foo.    bar foo bar foo foo. bar foo bar    foo foo.
{textformat wrap=40 indent=4 indent_first=4}     this is foo.    this is foo.    this is foo.    this is foo.    this is foo.    this is foo.     this is bar.     bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.     {/textformat}

the above example will output:

this is foo. this is foo. this    is foo. this is foo. this is foo.    this is foo.     this is bar.     bar foo bar foo foo. bar foo bar    foo foo. bar foo bar foo foo. bar    foo bar foo foo. bar foo bar foo    foo. bar foo bar foo foo. bar foo    bar foo foo.
{textformat style="email"}     this is foo.    this is foo.    this is foo.    this is foo.    this is foo.    this is foo.     this is bar.     bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.    bar foo bar foo     foo.     {/textformat}

the above example will output:

this is foo. this is foo. this is foo. this is foo. this is foo. this is    foo.     this is bar.     bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo    bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo    foo.

see also {strip} and {wordwrap}.