validation - Validating fields as unique in cakephp 3.0 -


how validate field unique in cakephp 3.0? there doesn't appear validation function listed in api.

you want use rule validateunique. example, check email address unique on userstable:-

public function validationdefault(validator $validator) {     $validator->add(         'email',          ['unique' => [             'rule' => 'validateunique',              'provider' => 'table',              'message' => 'not unique']         ]     );      return $validator; } 

details can found in the api docs.


Comments

Popular posts from this blog

javascript - Create websocket without connecting -

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

android - Linear layout children not scrolling -