SproutCMS

This is the code documentation for the SproutCMS project

function check()

Check the value of a field against a validation method, storing any error messages received
Additional arguments are passed to the underlying method

Methods which are on classes within the Sprout\Helpers namespace do not need the namespace
specified on the function name

If a field has already been checked with Validator::required and the field was empty,
this function will not report errors (but will still return an appropriate value)

If a empty value is provided, it is not validated - returns true

Usage

bool $Validator->check ( string $field_name , callable $func );

Arguments

  1. string $field_name
    The field to check
  2. callable $func
    The function or method to call.

Return value

  • bool
    True if validation was successful, false if it failed