Jump to main content Jump to doc navigation

xPDOValidator::validate

Executes validation against the object attached to this validator. May also accept an array of parameters to pass to the validation rule.

Syntax

API Doc: http://api.modxcms.com/xpdo/om/xPDOValidator.html#

boolean validate ([array $parameters = array()])

Example

Check to see if any validation errors occurred.

$validator = $obj->getValidator();
if ($validator->validate()) {
   echo 'Errors occurred!';
}

See Also

  1. xPDOValidator.addMessage
  2. xPDOValidator.getMessages
  3. xPDOValidator.hasMessages
  4. xPDOValidator.validate