/** * Use the Wave Validator to check form input. If errors exist, the offending * values are inserted into $this->_input_errors. * * @param $schema - The validation schema for the Jade Validator * @param $data - [optional] Supply a data array to use for validation * @return Boolean true for no errors, or false. */ protected function inputValid($schema, $data = null) { if ($data === null) { $data = $this->_data; } try { $output = Validator::validate($schema, $data); $this->_cleaned = $output; return true; } catch (InvalidInputException $e) { $this->_input_errors = $e->getViolations(); } return false; }