Documentation · ViewHelper reference

XSD schema file | vhs master

Format / WordWrapViewHelper

Wordwrap: Wrap a string at provided character count

Wraps a string to $limit characters and at $break character while maintaining complete words. Concatenates the resulting strings with $glue. Code is heavily inspired by Codeigniter's word_wrap helper. /

  • Tag usage example

    <v:format.wordWrap subject="NULL" limit="123" break="'
    '" glue="'
    '">
    	<!-- tag content - may be ignored! -->
    </v:format.wordWrap>
  • Inline usage example

    {v:format.wordWrap(subject: 'NULL', limit: 123, break: ''
    '', glue: ''
    '')}

Arguments

Argument Description Type
break

Character to wrap text at

string
glue

Character to concatenate parts with after wrapping

string
limit

Maximum length of resulting parts after wrapping

integer
subject

Text to wrap

string
Required attribute

Revision history