2016-08-11 1 views

Antwort

2

Außer requirePresence, allowEmpty und notEmpty, alle integrierten Regeln Karte zu statischen Methoden auf der \Cake\Validation\Validation Klasse entsprechen, die Sie selbst bei Bedarf manuell aufrufen kann.

Die email Regel verwendet Validation::email(), so können Sie es verwenden, wie

public function myValidationRule($value, $context) { 
    // ... 
    $isValid = \Cake\Validation\Validation::email($value); 
    // ... 
} 

Siehe auch

0
public function myValidationRule($value,$context){ 
    // HERE -- you can get your email in $value and other values in $context 
    // HERE you can add any of your custome validation rule 
    // for example 
    return $value==null; 
    // it will return true if your email is null. 
} 
Verwandte Themen