public getInitialValue ( ) : string | ||
리턴 | string | the initial value of the associated input control. Defaults to empty string unless the control has a prompt value set. If the associated input control does not change from this initial value upon postback, the validation fails. |
public function getInitialValue()
{
return $this->getViewState('InitialValue', $this->getControlPromptValue());
}
public function testGetEmptyInitialValue() { $validator = new TRequiredFieldValidator(); try { $value = $validator->getInitialValue(); } catch (TConfigurationException $e) { //since prado 3.2.2 you need to set at least ControlToValidate $value = ''; } $this->assertEquals('', $value); }