SproutCMS

This is the code documentation for the SproutCMS project

function checkboxSet()

Returns HTML containing multiple checkboxes, with values to store in a SET column or similar

Usage

string Fb::checkboxSet ( string $name , array $attrs , array $settings );

Example

Form::nextFieldDetails('Colours to include', false);
echo Form::checkboxSet('colours', [], [
    'red' => 'Red, the colour of cherries and strawberries',
    'green' => 'Green, the colour of leaves',
    'blue' => 'Blue, the colour of the sky and ocean',
]);

Arguments

  1. string $name
    Name for each INPUT element. Empty brackets will be appended if not supplied, i.e. [].
  2. array $attrs
    Attributes for all input elements, e.g. ['class' => 'super-input', 'style' => 'font-style: italic']
  3. array $settings
    Keys are the values available in the set, and values their labels. These can match, and
           can be easily filled by a call to Pdb::extractEnumArr

Return value

  • string
    HTML containing DIV tags containing INPUT and LABEL tags.