SproutCMS

This is the code documentation for the SproutCMS project

function collateData()

Collates POST data using specified config options

Usage

array JsonForm::collateData ( array $conf , string $mode , Validator $validator , int $item_id );

Arguments

  1. array $conf
    Config, typically loaded by Controller::loadFormJson()
  2. string $mode
    Form mode, e.g. 'add', 'edit' or a custom value
  3. Validator $validator
    To validate the data; must be created externally so it can be used for other
           validation before and/or after collating the JsonForm data
  4. int $item_id
    The record being edited or 0 for record adding

Return value

  • array
    [0] Data for insert/update, field => value [1] Errors generated, field => error