public static function apply($field, $clientOptions, $render = true)
	{
		if ( isset($field->inputOptions['maxlength'])) {
			$maxLength = $field->inputOptions['maxlength'];
		} else {
			$maxLength = static::getMaxLength($field->model, Html::getAttributeName($field->attribute));
		}
		if ( ! empty($maxLength) ) {
			$field->inputOptions['maxlength'] = $maxLength;
			$id = Html::getInputId($field->model, $field->attribute);
			static::widget( [
				'selector' => '#'.$id,
				'clientOptions' => $clientOptions
			]);
		}
		if ( $render ) {
			echo $field;
		}
		return $field;
	}