Class \Prado\Web\UI\WebControls\TCompareValidator
TCompareValidator compares the value entered by the user into an input control with the value entered into another input control or a constant value. To compare the associated input control with another input control, set the \Prado\Web\UI\WebControls\setControlToCompare property to the ID path of the control to compare with. To compare the associated input control with a constant value, specify the constant value to compare with by setting the \Prado\Web\UI\WebControls\setValueToCompare property.
The \Prado\Web\UI\WebControls\setDataType property is used to specify the data type of both comparison values. Both values are automatically converted to this data type before the comparison operation is performed. The following value types are supported:
- Integer A 32-bit signed integer data type.
- Float A double-precision floating point number data type.
- Date A date data type. The format can be specified by the \Prado\Web\UI\WebControls\setDateFormat property
- String A string data type.
Use the \Prado\Web\UI\WebControls\setOperator property to specify the type of comparison to perform. Valid operators include Equal, NotEqual, GreaterThan, GreaterThanEqual, LessThan and LessThanEqual.
Class hierarchy
- \Prado\Web\UI\WebControls\TCompareValidator
- \Prado\Web\UI\WebControls\TBaseValidator implements IValidator
- \Prado\Web\UI\WebControls\TLabel implements IDataRenderer
- \Prado\Web\UI\WebControls\TWebControl implements IStyleable
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.0
public
|
evaluateIsValid() : bool
This method overrides the parent's implementation.
The validation succeeds if the input data compares successfully. The validation always succeeds if ControlToValidate is not specified or the input data is empty. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
setControlToCompare(string $value) : mixed
Sets the input component to compare with the input control being validated.
|
public
|
setDataType(TValidationDataType $value) : mixed
Sets the data type that the values being
compared are converted to before the comparison is made.
|
public
|
|
public
|
|
public
|
setValueToCompare(string $value) : mixed
Sets the constant value to compare with the value entered by the user into the input component being validated.
|
protected
|
getClientClassName() : string
Gets the name of the javascript class responsible for performing validation for this control.
This method overrides the parent implementation. |
protected
|
getClientScriptOptions() : array<string|int, mixed>
Returns an array of javascript validator options.
|
protected
|
getComparisonValues(string $value1, string $value2) : array<string|int, mixed>
Parse the pair of values into the appropriate value type.
|