SproutCMS

This is the code documentation for the SproutCMS project

function totalselector()

Renders HTML containing a total selector UI. Output field value for the total is in
a hidden field. The specific counts for each are also available

Usage

string Fb::totalselector ( string $name , array $attrs , array $options );

Arguments

  1. string $name
    The field name
  2. array $attrs
    Attributes for the input element,
        e.g. ['id' => 'my-totalselector', class' => 'super-input', 'style' => 'font-style: italic']
  3. array $options
    Various options
        'singular'                Label for total
        'plural'                  Plural label for total
        'fields'                  Array of fields that contribute to the total count
            'name'                Internal name of field, plaintext
            'label'               Field label (Sentence case), plaintext
            'helptext'            Additional helptext for the field, optional, limited subset html
            'min'                 Minimum allowed value, optional, default 0
            'max'                 Maximum allowed value, optional, default unlimited

Return value

  • string
    HTML