PHP 클래스 Prado\Web\UI\WebControls\TTextBox

TTextBox displays a text box on the Web page for user input. The text displayed in the TTextBox control is determined by the {@link setText Text} property. You can create a SingleLine, a MultiLine, or a Password text box by setting the {@link setTextMode TextMode} property. If the TTextBox control is a multiline text box, the number of rows it displays is determined by the {@link setRows Rows} property, and the {@link setWrap Wrap} property can be used to determine whether to wrap the text in the component. Additional {@link setTextMode TextMode} types enable the use of new input types added with html5, eg. Color, Date, Email. To specify the display width of the text box, in characters, set the {@link setColumns Columns} property. To prevent the text displayed in the component from being modified, set the {@link setReadOnly ReadOnly} property to true. If you want to limit the user input to a specified number of characters, set the {@link setMaxLength MaxLength} property. To use AutoComplete feature, set the {@link setAutoCompleteType AutoCompleteType} property. If {@link setAutoPostBack AutoPostBack} is set true, updating the text box and then changing the focus out of it will cause postback action. And if {@link setCausesValidation CausesValidation} is true, validation will also be processed, which can be further restricted within a {@link setValidationGroup ValidationGroup}. WARNING: Be careful if you want to display the text collected via TTextBox. Malicious cross-site script may be injected in. You may use {@link getSafeText SafeText} to prevent this problem. NOTE: If you set {@link setWrap Wrap} to false or use {@link setAutoCompleteType AutoCompleteType}, the generated HTML output for the textbox will not be XHTML-compatible. Currently, no alternatives are available.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends TWebControl, implements Prado\Web\UI\IPostBackDataHandler, implements Prado\Web\UI\IValidatable, implements Prado\IDataRenderer
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
getAutoCompleteType ( ) : TTextBoxAutoCompleteType
getAutoPostBack ( ) : boolean
getAutoTrim ( ) : boolean
getCausesValidation ( ) : boolean
getColumns ( ) : integer
getData ( ) : string Returns the text content of the TTextBox control.
getDataChanged ( ) : boolean Returns a value indicating whether postback has caused the control data change.
getEnableClientScript ( ) : boolean
getIsValid ( ) : boolean Returns true if this control validated successfully.
getMaxLength ( ) : integer
getPersistPassword ( ) : boolean
getReadOnly ( ) : boolean
getRows ( ) : integer
getSafeText ( ) : string
getText ( ) : string
getTextMode ( ) : TTextBoxMode
getValidationGroup ( ) : string
getValidationPropertyValue ( ) : mixed Returns the value to be validated.
getWrap ( ) : boolean
loadPostData ( $key, $values ) : boolean Loads user input data.
onTextChanged ( $param ) Raises OnTextChanged event.
raisePostDataChangedEvent ( ) Raises postdata changed event.
renderBeginTag ( $writer ) Renders an additional line-break after the opening tag when it is in MultiLine text mode.
renderContents ( $writer ) Renders the body content of the textbox when it is in MultiLine text mode.
setAutoCompleteType ( $value )
setAutoPostBack ( $value ) Sets the value indicating if postback automatically.
setAutoTrim ( $value ) Sets the value indicating if the input text should be trimmed spaces
setCausesValidation ( $value )
setColumns ( $value ) Sets the display width of the text box in characters.
setData ( $value ) Sets the text content of the TTextBox control.
setEnableClientScript ( $value )
setIsValid ( $value )
setMaxLength ( $value ) Sets the maximum number of characters allowed in the text box.
setPersistPassword ( $value )
setReadOnly ( $value )
setRows ( $value ) Sets the number of rows displayed in a multiline text box.
setText ( $value ) Sets the text content of the TTextBox control.
setTextMode ( $value ) Sets the behavior mode of the TTextBox component.
setValidationGroup ( $value )
setWrap ( $value ) Sets the value indicating whether the text content wraps within a multiline text box.

보호된 메소드들

메소드 설명
addAttributesToRender ( $writer ) Adds attribute name-value pairs to renderer.
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing postback for this control.
getPostBackOptions ( ) : array Gets the post back options for this textbox.
getSafeTextParser ( ) : mixed
getTagName ( ) : string
renderClientControlScript ( $writer ) Renders the javascript for textbox.

메소드 상세

addAttributesToRender() 보호된 메소드

This method overrides the parent implementation with additional textbox specific attributes.
protected addAttributesToRender ( $writer )

getAutoCompleteType() 공개 메소드

public getAutoCompleteType ( ) : TTextBoxAutoCompleteType
리턴 TTextBoxAutoCompleteType the AutoComplete type of the textbox

getAutoPostBack() 공개 메소드

public getAutoPostBack ( ) : boolean
리턴 boolean a value indicating whether an automatic postback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to false.

getAutoTrim() 공개 메소드

public getAutoTrim ( ) : boolean
리턴 boolean a value indicating whether the input text should be trimmed spaces. Defaults to false.

getCausesValidation() 공개 메소드

public getCausesValidation ( ) : boolean
리턴 boolean whether postback event trigger by this text box will cause input validation, default is true.

getClientClassName() 보호된 메소드

This method overrides the parent implementation.
protected getClientClassName ( ) : string
리턴 string the javascript class name

getColumns() 공개 메소드

public getColumns ( ) : integer
리턴 integer the display width of the text box in characters, default is 0 meaning not set.

getData() 공개 메소드

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link getText()}.
또한 보기: getText
부터: 3.1.0
public getData ( ) : string
리턴 string the text content of the TTextBox control.

getDataChanged() 공개 메소드

This method is required by the \Prado\Web\UI\IPostBackDataHandler interface.
public getDataChanged ( ) : boolean
리턴 boolean whether postback has caused the control data change. False if the page is not in postback mode.

getEnableClientScript() 공개 메소드

public getEnableClientScript ( ) : boolean
리턴 boolean whether to render javascript.

getIsValid() 공개 메소드

Defaults to true.
public getIsValid ( ) : boolean
리턴 boolean wether this control validated successfully.

getMaxLength() 공개 메소드

public getMaxLength ( ) : integer
리턴 integer the maximum number of characters allowed in the text box, default is 0 meaning not set.

getPersistPassword() 공개 메소드

public getPersistPassword ( ) : boolean
리턴 boolean whether password should be displayed in the textbox during postback. Defaults to false. This property only applies when TextMode='Password'.

getPostBackOptions() 보호된 메소드

Gets the post back options for this textbox.
protected getPostBackOptions ( ) : array
리턴 array

getReadOnly() 공개 메소드

public getReadOnly ( ) : boolean
리턴 boolean whether the textbox is read only, default is false.

getRows() 공개 메소드

public getRows ( ) : integer
리턴 integer the number of rows displayed in a multiline text box, default is 4

getSafeText() 공개 메소드

public getSafeText ( ) : string
리턴 string safe text content with javascript stripped off

getSafeTextParser() 보호된 메소드

protected getSafeTextParser ( ) : mixed
리턴 mixed safe text parser

getTagName() 보호된 메소드

protected getTagName ( ) : string
리턴 string tag name of the textbox

getText() 공개 메소드

public getText ( ) : string
리턴 string the text content of the TTextBox control.

getTextMode() 공개 메소드

public getTextMode ( ) : TTextBoxMode
리턴 TTextBoxMode the behavior mode of the TTextBox component. Defaults to TTextBoxMode::SingleLine.

getValidationGroup() 공개 메소드

public getValidationGroup ( ) : string
리턴 string the group of validators which the text box causes validation upon postback

getValidationPropertyValue() 공개 메소드

This methid is required by \Prado\Web\UI\IValidatable interface.
public getValidationPropertyValue ( ) : mixed
리턴 mixed the value of the property to be validated.

getWrap() 공개 메소드

public getWrap ( ) : boolean
리턴 boolean whether the text content wraps within a multiline text box. Defaults to true.

loadPostData() 공개 메소드

This method is primarly used by framework developers.
public loadPostData ( $key, $values ) : boolean
리턴 boolean whether the data of the component has been changed

onTextChanged() 공개 메소드

This method is invoked when the value of the {@link getText Text} property changes on postback. If you override this method, be sure to call the parent implementation to ensure the invocation of the attached event handlers.
public onTextChanged ( $param )

raisePostDataChangedEvent() 공개 메소드

This method is required by {@link \Prado\Web\UI\IPostBackDataHandler} interface. It is invoked by the framework when {@link getText Text} property is changed on postback. This method is primarly used by framework developers.

renderBeginTag() 공개 메소드

Renders an additional line-break after the opening tag when it is in MultiLine text mode.
public renderBeginTag ( $writer )

renderClientControlScript() 보호된 메소드

Renders the javascript for textbox.
protected renderClientControlScript ( $writer )

renderContents() 공개 메소드

Renders the body content of the textbox when it is in MultiLine text mode.
public renderContents ( $writer )

setAutoCompleteType() 공개 메소드

public setAutoCompleteType ( $value )

setAutoPostBack() 공개 메소드

An automatic postback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component.
public setAutoPostBack ( $value )

setAutoTrim() 공개 메소드

Sets the value indicating if the input text should be trimmed spaces
public setAutoTrim ( $value )

setCausesValidation() 공개 메소드

public setCausesValidation ( $value )

setColumns() 공개 메소드

Sets the display width of the text box in characters.
public setColumns ( $value )

setData() 공개 메소드

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link setText()}.
또한 보기: setText
부터: 3.1.0
public setData ( $value )

setEnableClientScript() 공개 메소드

public setEnableClientScript ( $value )

setIsValid() 공개 메소드

public setIsValid ( $value )

setMaxLength() 공개 메소드

Sets the maximum number of characters allowed in the text box.
public setMaxLength ( $value )

setPersistPassword() 공개 메소드

public setPersistPassword ( $value )

setReadOnly() 공개 메소드

public setReadOnly ( $value )

setRows() 공개 메소드

Sets the number of rows displayed in a multiline text box.
public setRows ( $value )

setText() 공개 메소드

Sets the text content of the TTextBox control.
public setText ( $value )

setTextMode() 공개 메소드

Sets the behavior mode of the TTextBox component.
public setTextMode ( $value )

setValidationGroup() 공개 메소드

public setValidationGroup ( $value )

setWrap() 공개 메소드

Sets the value indicating whether the text content wraps within a multiline text box.
public setWrap ( $value )