芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/xmintal-back/vendor/yiisoft/yii2/validators/TrimValidator.php
$attribute; if (!$this->skipOnArray || !is_array($value)) { $model->$attribute = is_array($value) ? array_map([$this, 'trimValue'], $value) : $this->trimValue($value); } } /** * Converts given value to string and strips declared characters. * * @param mixed $value the value to strip * @return string */ protected function trimValue($value) { return $this->isEmpty($value) ? '' : trim((string) $value, $this->chars ?: " \n\r\t\v\x00"); } /** * @inheritDoc */ public function clientValidateAttribute($model, $attribute, $view) { if ($this->skipOnArray && is_array($model->$attribute)) { return null; } ValidationAsset::register($view); $options = $this->getClientOptions($model, $attribute); return 'value = yii.validation.trim($form, attribute, ' . Json::htmlEncode($options) . ', value);'; } /** * @inheritDoc */ public function getClientOptions($model, $attribute) { return [ 'skipOnArray' => (bool) $this->skipOnArray, 'skipOnEmpty' => (bool) $this->skipOnEmpty, 'chars' => $this->chars ?: false, ]; } }