PHP Class Prado\Web\UI\WebControls\TValidationSummary

TValidationSummary displays a summary of validation errors inline on a Web page, in a message box, or both. By default, a validation summary will collect {@link TBaseValidator::getErrorMessage ErrorMessage} of all failed validators on the page. If {@link getValidationGroup ValidationGroup} is not empty, only those validators who belong to the group will show their error messages in the summary. The summary can be displayed as a list, as a bulleted list, or as a single paragraph based on the {@link setDisplayMode DisplayMode} property. The messages shown can be prefixed with {@link setHeaderText HeaderText}. The summary can be displayed on the Web page and in a message box by setting the {@link setShowSummary ShowSummary} and {@link setShowMessageBox ShowMessageBox} properties, respectively. Note, the latter is only effective when {@link setEnableClientScript EnableClientScript} is true.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TWebControl
ファイルを表示 Open project: pradosoft/prado

Public Methods

Method Description
__construct ( ) Constructor.
getAutoUpdate ( ) : boolean Gets the auto-update for this summary.
getClientSide ( ) : TClientSideValidationSummaryOptions
getDisplay ( ) : TValidationSummaryDisplayStyle
getDisplayMode ( ) : TValidationSummaryDisplayMode
getEnableClientScript ( ) : boolean
getHeaderText ( ) : string
getScrollToSummary ( ) : boolean
getShowAnchor ( ) : boolean
getShowMessageBox ( ) : boolean
getShowSummary ( ) : boolean
getValidationGroup ( ) : string
renderContents ( $writer ) : string Overrides parent implementation by rendering TValidationSummary-specific presentation.
setAutoUpdate ( $value ) Sets the summary to auto-update on the client-side
setDisplay ( $value )
setDisplayMode ( $value )
setEnableClientScript ( $value )
setHeaderText ( $value ) Sets the header text to be displayed at the top of the summary
setScrollToSummary ( $value )
setShowAnchor ( $value )
setShowMessageBox ( $value )
setShowSummary ( $value )
setValidationGroup ( $value )

Protected Methods

Method Description
addAttributesToRender ( $writer )
createClientScript ( ) : TClientSideValidationSummaryOptions
getClientScriptOptions ( ) : array Get a list of options for the client-side javascript validation summary.
getErrorMessages ( ) : array Get the list of validation error messages.
renderBulletList ( $writer ) : string Render the validation summary as a bullet list.
renderHeaderOnly ( $writer ) Render the validation summary header text only.
renderJsSummary ( ) Render the javascript for validation summary.
renderList ( $writer ) : string Render the validation summary as a simple list.
renderSingleParagraph ( $writer ) : string Render the validation summary as a paragraph.

Method Details

__construct() public method

This method sets the foreground color to red.
public __construct ( )

addAttributesToRender() protected method

protected addAttributesToRender ( $writer )

createClientScript() protected method

protected createClientScript ( ) : TClientSideValidationSummaryOptions
return TClientSideValidationSummaryOptions javascript validation summary event options.

getAutoUpdate() public method

Gets the auto-update for this summary.
public getAutoUpdate ( ) : boolean
return boolean automatic client-side summary updates. Defaults to true.

getClientScriptOptions() protected method

Get a list of options for the client-side javascript validation summary.
protected getClientScriptOptions ( ) : array
return array list of options for the summary

getClientSide() public method

public getClientSide ( ) : TClientSideValidationSummaryOptions
return TClientSideValidationSummaryOptions client-side validation summary event options.

getDisplay() public method

public getDisplay ( ) : TValidationSummaryDisplayStyle
return TValidationSummaryDisplayStyle the style of displaying the error messages. Defaults to TValidationSummaryDisplayStyle::Fixed.

getDisplayMode() public method

public getDisplayMode ( ) : TValidationSummaryDisplayMode
return TValidationSummaryDisplayMode the mode of displaying error messages. Defaults to TValidationSummaryDisplayMode::BulletList.

getEnableClientScript() public method

public getEnableClientScript ( ) : boolean
return boolean whether the TValidationSummary component updates itself using client-side script. Defaults to true.

getErrorMessages() protected method

Get the list of validation error messages.
protected getErrorMessages ( ) : array
return array list of validator error messages.

getHeaderText() public method

public getHeaderText ( ) : string
return string the header text displayed at the top of the summary

getScrollToSummary() public method

public getScrollToSummary ( ) : boolean
return boolean whether scroll summary into viewport or not. Defaults to true.

getShowAnchor() public method

public getShowAnchor ( ) : boolean
return boolean whether the validation summary should be anchored. Defaults to false.

getShowMessageBox() public method

public getShowMessageBox ( ) : boolean
return boolean whether the validation summary is displayed in a message box. Defaults to false.

getShowSummary() public method

public getShowSummary ( ) : boolean
return boolean whether the validation summary is displayed inline. Defaults to true.

getValidationGroup() public method

public getValidationGroup ( ) : string
return string the group which this validator belongs to

renderBulletList() protected method

Render the validation summary as a bullet list.
protected renderBulletList ( $writer ) : string
return string summary bullet list

renderContents() public method

Overrides parent implementation by rendering TValidationSummary-specific presentation.
public renderContents ( $writer ) : string
return string the rendering result

renderHeaderOnly() protected method

Render the validation summary header text only.
protected renderHeaderOnly ( $writer )

renderJsSummary() protected method

Render the javascript for validation summary.
protected renderJsSummary ( )

renderList() protected method

Render the validation summary as a simple list.
protected renderList ( $writer ) : string
return string summary list

renderSingleParagraph() protected method

Render the validation summary as a paragraph.
protected renderSingleParagraph ( $writer ) : string
return string summary paragraph

setAutoUpdate() public method

Sets the summary to auto-update on the client-side
public setAutoUpdate ( $value )

setDisplay() public method

public setDisplay ( $value )

setDisplayMode() public method

public setDisplayMode ( $value )

setEnableClientScript() public method

public setEnableClientScript ( $value )

setHeaderText() public method

Sets the header text to be displayed at the top of the summary
public setHeaderText ( $value )

setScrollToSummary() public method

public setScrollToSummary ( $value )

setShowAnchor() public method

public setShowAnchor ( $value )

setShowMessageBox() public method

public setShowMessageBox ( $value )

setShowSummary() public method

public setShowSummary ( $value )

setValidationGroup() public method

public setValidationGroup ( $value )