Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (27 sloc) 0.739 kB
<?php
/**
* CustomValidationModel
*
* It uses core "notEmpty" validation.
*
* a custom validation "CustomValidationObject::myCustomRule" loaded
* from /Model/Validation/CustomValidationObject
*
* and a non-existing validation from "NonExistingObject::nonExistingMethod".
* this rule will trigger a notice
*/
class CustomValidationModel extends AppModel {
public $useTable = false;
public $validate = array(
'name' => 'notEmpty',
'surname' => array(
'rule' => 'CustomValidationObject::myCustomRule',
'message' => 'value not accepted'
),
'age' => 'NonExistingObject::nonExistingMethod',
'odd_number' => array(
'rule' => 'CustomValidationObject::odd',
'message' => 'Please insert odd number'
)
);
}
Jump to Line
Something went wrong with that request. Please try again.