PHP Класс 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
С версии: 3.2
Автор: Brad Anderson ([email protected])
Наследование: extends Prado\TComponent
Показать файл Открыть проект

Открытые методы

Метод Описание
__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 )

Описание методов

__construct() публичный Метод

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

ensureTemplateDecoration() публичный Метод

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
Результат boolean returns true if the template decorations have been added

getPostContentsTemplate() публичный Метод

public getPostContentsTemplate ( ) : TTemplate | null
Результат TTemplate | null the template before the close tag in the TWebControl. Defaults to null.

getPostContentsText() публичный Метод

public getPostContentsText ( ) : string
Результат string the text before the close tag in the TWebControl

getPostTagTemplate() публичный Метод

public getPostTagTemplate ( ) : TTemplate | null
Результат TTemplate | null the template after the close tag in the TWebControl. Defaults to null.

getPostTagText() публичный Метод

public getPostTagText ( ) : string
Результат string the text before the close tag in the TWebControl

getPreContentsTemplate() публичный Метод

public getPreContentsTemplate ( ) : TTemplate | null
Результат TTemplate | null the template after the open tag in the TWebControl. Defaults to null.

getPreContentsText() публичный Метод

public getPreContentsText ( ) : string
Результат string the text after the open tag in the TWebControl

getPreTagTemplate() публичный Метод

public getPreTagTemplate ( ) : TTemplate | null
Результат TTemplate | null the template before the open tag in the TWebControl. Defaults to null.

getPreTagText() публичный Метод

public getPreTagText ( ) : string
Результат string gets the text before the open tag in the TWebControl

getUseState() публичный Метод

public getUseState ( ) : boolean
Результат boolean if the templates in this decoration need state. This defaults to false

instantiate() публичный Метод

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() публичный Метод

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

renderPostTagText() публичный Метод

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

renderPreContentsText() публичный Метод

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

renderPreTagText() публичный Метод

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

setPostContentsTemplate() публичный Метод

public setPostContentsTemplate ( $value )

setPostContentsText() публичный Метод

public setPostContentsText ( $value )

setPostTagTemplate() публичный Метод

public setPostTagTemplate ( $value )

setPostTagText() публичный Метод

public setPostTagText ( $value )

setPreContentsTemplate() публичный Метод

public setPreContentsTemplate ( $value )

setPreContentsText() публичный Метод

public setPreContentsText ( $value )

setPreTagTemplate() публичный Метод

public setPreTagTemplate ( $value )

setPreTagText() публичный Метод

public setPreTagText ( $value )

setUseState() публичный Метод

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.