SproutCMS

This is the code documentation for the SproutCMS project

function validate()

Usage

void $MultiStepFormController->validate ( int &$step , array $reqd , array $rules [, Validator $valid ] );

Arguments

  1. int $step (by reference)
  2. array $reqd
    Names of required fields, e.g. ['name', 'email']
  3. array $rules
    Each element is an array which is passed to Validator::check,
           e.g. [['first_name', 'Validity::length', 0, 20], ['last_name', 'Validity::length', 0, 20]]
  4. Validator $valid = NULL
    a Validator, or null to create one on the fly. Specifying a Validator
           allows the addition of rules/errors before this method is called.

Return value

  • void
    A redirect will occur if validation fails