Skip to content

CRequiredValidator: Make trim an option #2343

Closed
KJLJon opened this Issue Apr 15, 2013 · 2 comments

3 participants

@KJLJon
KJLJon commented Apr 15, 2013

I think that isEmpty should allow for the option of setting the trim to true or false on CRequiredValidator.

Currently (line 61):

elseif($this->isEmpty($value,true))

Would like (line 61):

elseif($this->isEmpty($value,$this->trim))

Would have to define:

/**
 * @var boolean whether it trims the value in comparing the string
 * When this is false, the attribute value can contain a non-trimmed value like a space
 * Defaults to true, meaning the value will be trimmed
 */
public $trim = true;
@AnatolyRugalev

I think this is a good poposal. As I see parameter $trim of isEmpty() function is used only by CRequiredValidator

@resurtm resurtm closed this Apr 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.