CRequiredValidator: Make trim an option #2343

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

Comments

Projects
None yet
3 participants
@KJLJon
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@AnatolyRugalev

AnatolyRugalev Apr 16, 2013

Contributor

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

Contributor

AnatolyRugalev commented Apr 16, 2013

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

@resurtm

This comment has been minimized.

Show comment
Hide comment
Contributor

resurtm commented Apr 18, 2013

@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