From e9143dcef16136c1cb1c9be59deae39f596a6116 Mon Sep 17 00:00:00 2001 From: saeid Date: Mon, 25 Dec 2017 13:57:00 +0330 Subject: [PATCH] Update Form README.md to use validationDefault() --- src/Form/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Form/README.md b/src/Form/README.md index c3e98806856..a5b5af56e52 100644 --- a/src/Form/README.md +++ b/src/Form/README.md @@ -25,7 +25,7 @@ class ContactForm extends Form ->addField('body', ['type' => 'text']); } - protected function _buildValidator(Validator $validator) + public function validationDefault(Validator $validator) { return $validator->add('name', 'length', [ 'rule' => ['minLength', 10], @@ -47,7 +47,7 @@ class ContactForm extends Form In the above example we see the 3 hook methods that forms provide: - `_buildSchema()` is used to define the schema data. You can define field type, length, and precision. -- `_buildValidator()` Gets a `Cake\Validation\Validator` instance that you can attach validators to. +- `validationDefault()` Gets a `Cake\Validation\Validator` instance that you can attach validators to. - `_execute()` lets you define the behavior you want to happen when `execute()` is called and the data is valid. You can always define additional public methods as you need as well.