diff --git a/en/core-libraries/validation.rst b/en/core-libraries/validation.rst index 245ceb4e04..fd81fb53d5 100644 --- a/en/core-libraries/validation.rst +++ b/en/core-libraries/validation.rst @@ -168,16 +168,16 @@ Validator instances come with a 'default' provider setup automatically. The default provider is mapped to the :php:class:`~Cake\\Validation\\Validation` class. This makes it simple to use the methods on that class as validation rules. When using Validators and the ORM together, additional providers are -configured for the table and entity objects. You can use the ``provider()`` +configured for the table and entity objects. You can use the ``setProvider()`` method to add any additional providers your application needs:: $validator = new Validator(); // Use an object instance. - $validator->provider('custom', $myObject); + $validator->setProvider('custom', $myObject); // Use a class name. Methods must be static. - $validator->provider('custom', 'App\Model\Validation'); + $validator->setProvider('custom', 'App\Model\Validation'); Validation providers can be objects, or class names. If a class name is used the methods must be static. To use a provider other than 'default', be sure to set @@ -203,7 +203,7 @@ model fields, depending on a country, ie:: public function validationDefault(Validator $validator) { // add the provider to the validator - $validator->provider('fr', 'Localized\Validation\FrValidation'); + $validator->setProvider('fr', 'Localized\Validation\FrValidation'); // use the provider in a field validation rule $validator->add('phoneField', 'myCustomRuleNameForPhone', [ 'rule' => 'phone',