1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- namespace yii\validators;
- class InlineValidator extends Validator
- {
-
- public $method;
-
- public $params;
-
- public $clientValidate;
-
- public function validateAttribute($model, $attribute)
- {
- $method = $this->method;
- if (is_string($method)) {
- $method = [$model, $method];
- }
- call_user_func($method, $attribute, $this->params, $this);
- }
-
- public function clientValidateAttribute($model, $attribute, $view)
- {
- if ($this->clientValidate !== null) {
- $method = $this->clientValidate;
- if (is_string($method)) {
- $method = [$model, $method];
- }
- return call_user_func($method, $attribute, $this->params, $this);
- }
- return null;
- }
- }
|