Documentation · ViewHelper reference

XSD schema file | vhs master

Count / SubstringViewHelper

Counts number of lines in a string.

Usage examples

<v:count.substring string="{myString}">{haystack}</v:count.substring> (output for example `2`

{haystack -> v:count.substring(string: myString)} when used inline

<v:count.substring string="{myString}" haystack="{haystack}" />

{v:count.substring(string: myString, haystack: haystack)}

/

  • Tag usage example

    <v:count.substring haystack="NULL" string="NULL">
    	<!-- tag content - may be ignored! -->
    </v:count.substring>
  • Inline usage example

    {v:count.substring(haystack: 'NULL', string: 'NULL')}

Arguments

Argument Description Type
haystack

String to count substring in, if not provided as tag content

string
string

Substring to count occurrences of

string
Required attribute

Revision history