mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
made $messageType parameter of Validator::validationError optional, and added API docs to explain what (apparently) is going on
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@50638 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
79835098b0
commit
0a543a9ae1
@ -361,10 +361,19 @@ HTML;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validation Functions for each field type by default
|
||||
* javascript handler Functions for each field type by default
|
||||
* formfield doesnt have a validation function
|
||||
*
|
||||
* @todo shouldn't this be an abstract method?
|
||||
*/
|
||||
function jsValidation() {}
|
||||
|
||||
/**
|
||||
* Validation Functions for each field type by default
|
||||
* formfield doesnt have a validation function
|
||||
*
|
||||
* @todo shouldn't this be an abstract method?
|
||||
*/
|
||||
function validate(){return true;}
|
||||
|
||||
/**
|
||||
|
@ -8,8 +8,11 @@
|
||||
/**
|
||||
* This validation class handles all form and custom form validation through
|
||||
* the use of Required fields.
|
||||
*
|
||||
* Relies on javascript for client-side validation, and marking fields after serverside validation.
|
||||
*
|
||||
* Acts as a visitor to individual form fields.
|
||||
*
|
||||
* @todo Automatically mark fields after serverside validation and replace the form through
|
||||
* FormResponse if the request was made by ajax.
|
||||
*
|
||||
@ -37,7 +40,14 @@ abstract class Validator extends Object {
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
function validationError($fieldName,$message,$messageType){
|
||||
/**
|
||||
* Callback to register an error on a field (Called from implementations of {@link FormField::validate})
|
||||
*
|
||||
* @param $fieldName name of the field
|
||||
* @param $message error message to display
|
||||
* @param $messageType optional parameter, gets loaded into the HTML class attribute in the rendered output
|
||||
*/
|
||||
function validationError($fieldName,$message,$messageType=''){
|
||||
$this->errors[] = array(
|
||||
'fieldName' => $fieldName,
|
||||
'message' => $message,
|
||||
|
Loading…
Reference in New Issue
Block a user