PHP Class Prado\Web\UI\WebControls\TWebControlDecorator

A TWebControlDecorator can be applied to a {@link TWebControl} to customize its rendering. TWebControlDecorator can add custom html code before and after both the open and close tag of a {@link TWebControl}. The html code can be an user-defined text or an external template file that will be instantiated and rendered in place. This is an easy way to have your look and feel depend upon the theme instead of writing specific html in your templates to achieve your website desires. Here is an example of how to code your theme skin:
The order of the inclusion of the decoration into the page goes like this: * PreTagTemplate * PreTagText * TWebControl Open Tag Rendered * PreContentsText * PreContentsTemplate * TWebControl Children Rendered * PostContentsTemplate * PostContentsText * TWebControl CloseTag Rendered * PostTagText * PostTagTemplate
Since: 3.2
Author: Brad Anderson ([email protected])
Inheritance: extends Prado\TComponent
Afficher le fichier Open project: pradosoft/prado

Méthodes publiques

Méthode Description
__construct ( $control, $onlyinternal = false ) Constructor.
ensureTemplateDecoration ( $sender = null, $param = null ) : boolean This method places the templates around the open and close tag. This takes a parameter which is to specify the control to get the outer template decoration. If no outer control is specified
getPostContentsTemplate ( ) : TTemplate | null
getPostContentsText ( ) : string
getPostTagTemplate ( ) : TTemplate | null
getPostTagText ( ) : string
getPreContentsTemplate ( ) : TTemplate | null
getPreContentsText ( ) : string
getPreTagTemplate ( ) : TTemplate | null
getPreTagText ( ) : string
getUseState ( ) : boolean
instantiate ( $outercontrol = null ) this is a framework call. The Text decoration can't influence the object hierarchy because they are rendered into into the writer directly.
renderPostContentsText ( $writer ) This method places the post contents text into the {@link TTextWriter}
renderPostTagText ( $writer ) This method places the post tag text into the {@link TTextWriter}
renderPreContentsText ( $writer ) This method places the pre contents text into the {@link TTextWriter}
renderPreTagText ( $writer ) This method places the pre tag text into the {@link TTextWriter}
setPostContentsTemplate ( $value )
setPostContentsText ( $value )
setPostTagTemplate ( $value )
setPostTagText ( $value )
setPreContentsTemplate ( $value )
setPreContentsText ( $value )
setPreTagTemplate ( $value )
setPreTagText ( $value )
setUseState ( boolean $value )

Method Details

__construct() public méthode

Initializes the control .
public __construct ( $control, $onlyinternal = false )

ensureTemplateDecoration() public méthode

This method places the templates around the open and close tag. This takes a parameter which is to specify the control to get the outer template decoration. If no outer control is specified
public ensureTemplateDecoration ( $sender = null, $param = null ) : boolean
Résultat boolean returns true if the template decorations have been added

getPostContentsTemplate() public méthode

public getPostContentsTemplate ( ) : TTemplate | null
Résultat TTemplate | null the template before the close tag in the TWebControl. Defaults to null.

getPostContentsText() public méthode

public getPostContentsText ( ) : string
Résultat string the text before the close tag in the TWebControl

getPostTagTemplate() public méthode

public getPostTagTemplate ( ) : TTemplate | null
Résultat TTemplate | null the template after the close tag in the TWebControl. Defaults to null.

getPostTagText() public méthode

public getPostTagText ( ) : string
Résultat string the text before the close tag in the TWebControl

getPreContentsTemplate() public méthode

public getPreContentsTemplate ( ) : TTemplate | null
Résultat TTemplate | null the template after the open tag in the TWebControl. Defaults to null.

getPreContentsText() public méthode

public getPreContentsText ( ) : string
Résultat string the text after the open tag in the TWebControl

getPreTagTemplate() public méthode

public getPreTagTemplate ( ) : TTemplate | null
Résultat TTemplate | null the template before the open tag in the TWebControl. Defaults to null.

getPreTagText() public méthode

public getPreTagText ( ) : string
Résultat string gets the text before the open tag in the TWebControl

getUseState() public méthode

public getUseState ( ) : boolean
Résultat boolean if the templates in this decoration need state. This defaults to false

instantiate() public méthode

This call attaches the ensureTemplateDecoration to the TPage onSaveStateComplete so these controls don't have page states. This is as close to not influencing the page as possible.
public instantiate ( $outercontrol = null )

renderPostContentsText() public méthode

This method places the post contents text into the {@link TTextWriter}
public renderPostContentsText ( $writer )

renderPostTagText() public méthode

This method places the post tag text into the {@link TTextWriter}
public renderPostTagText ( $writer )

renderPreContentsText() public méthode

This method places the pre contents text into the {@link TTextWriter}
public renderPreContentsText ( $writer )

renderPreTagText() public méthode

This method places the pre tag text into the {@link TTextWriter}
public renderPreTagText ( $writer )

setPostContentsTemplate() public méthode

public setPostContentsTemplate ( $value )

setPostContentsText() public méthode

public setPostContentsText ( $value )

setPostTagTemplate() public méthode

public setPostTagTemplate ( $value )

setPostTagText() public méthode

public setPostTagText ( $value )

setPreContentsTemplate() public méthode

public setPreContentsTemplate ( $value )

setPreContentsText() public méthode

public setPreContentsText ( $value )

setPreTagTemplate() public méthode

public setPreTagTemplate ( $value )

setPreTagText() public méthode

public setPreTagText ( $value )

setUseState() public méthode

public setUseState ( boolean $value )
$value boolean true to tell the decoration that the templates need state and should be placed in a control step before the state is saved.