Browse Source

Merge pull request #14075 from Kolyunya/fix-documentation

Fix validators documentation
tags/2.0.12
Dmitry Naumenko 8 years ago committed by GitHub
parent
commit
c443c25a1e
  1. 3
      framework/validators/StringValidator.php
  2. 2
      framework/validators/Validator.php

3
framework/validators/StringValidator.php

@ -159,6 +159,9 @@ class StringValidator extends Validator
return 'yii.validation.string(value, messages, ' . json_encode($options, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . ');';
}
/**
* @inheritdoc
*/
public function getClientOptions($model, $attribute)
{
$label = $model->getAttributeLabel($attribute);

2
framework/validators/Validator.php

@ -352,7 +352,7 @@ class Validator extends Component
* @param string $attribute the name of the attribute to be validated.
* @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script. Null if the validator does not support
* @return string|null the client-side validation script. Null if the validator does not support
* client-side validation.
* @see getClientOptions()
* @see \yii\widgets\ActiveForm::enableClientValidation

Loading…
Cancel
Save