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
Afficher le fichier Open project: pradosoft/prado

Méthodes publiques

Méthode 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 )

Méthodes protégées

Méthode 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 méthode

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

addAttributesToRender() protected méthode

protected addAttributesToRender ( $writer )

createClientScript() protected méthode

protected createClientScript ( ) : TClientSideValidationSummaryOptions
Résultat TClientSideValidationSummaryOptions javascript validation summary event options.

getAutoUpdate() public méthode

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

getClientScriptOptions() protected méthode

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

getClientSide() public méthode

public getClientSide ( ) : TClientSideValidationSummaryOptions
Résultat TClientSideValidationSummaryOptions client-side validation summary event options.

getDisplay() public méthode

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

getDisplayMode() public méthode

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

getEnableClientScript() public méthode

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

getErrorMessages() protected méthode

Get the list of validation error messages.
protected getErrorMessages ( ) : array
Résultat array list of validator error messages.

getHeaderText() public méthode

public getHeaderText ( ) : string
Résultat string the header text displayed at the top of the summary

getScrollToSummary() public méthode

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

getShowAnchor() public méthode

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

getShowMessageBox() public méthode

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

getShowSummary() public méthode

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

getValidationGroup() public méthode

public getValidationGroup ( ) : string
Résultat string the group which this validator belongs to

renderBulletList() protected méthode

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

renderContents() public méthode

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

renderHeaderOnly() protected méthode

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

renderJsSummary() protected méthode

Render the javascript for validation summary.
protected renderJsSummary ( )

renderList() protected méthode

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

renderSingleParagraph() protected méthode

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

setAutoUpdate() public méthode

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

setDisplay() public méthode

public setDisplay ( $value )

setDisplayMode() public méthode

public setDisplayMode ( $value )

setEnableClientScript() public méthode

public setEnableClientScript ( $value )

setHeaderText() public méthode

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

setScrollToSummary() public méthode

public setScrollToSummary ( $value )

setShowAnchor() public méthode

public setShowAnchor ( $value )

setShowMessageBox() public méthode

public setShowMessageBox ( $value )

setShowSummary() public méthode

public setShowSummary ( $value )

setValidationGroup() public méthode

public setValidationGroup ( $value )