SproutCMS

This is the code documentation for the SproutCMS project

function saveJsonData()

Automatically saves the data associated with a submission on a JSON-generated form

Usage

bool $Controller->saveJsonData ( array $conf , int &$item_id [, string $mode ] );

Arguments

  1. array $conf
    Config loaded from a JSON file
  2. int $item_id (by reference)
    Database ID of record to store data in. If zero, a new record will be inserted, and as this
           argument is a reference, it will be updated with the auto-increment ID generated by the insert.
  3. string $mode = ''
    Mode: 'add', 'edit', or something custom (e.g. 'duplicate', 'verify'). If blank,
           'add' or 'edit' will be automatically determined, based on $item_id

Return value

  • bool
    True if the save succeeded. If false is returned, errors will be saved in $_SESSION