Class \Prado\Web\UI\WebControls\TWebControlDecorator
A TWebControlDecorator can be applied to a TWebControl to customize its rendering. TWebControlDecorator can add custom html code before and after both the open and close tag of a 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:
<com:THeader3>
<prop:Decorator.PreTagText>
<!-- Surround the control with a div and apply a css class to it -->
<div class="imported-theme-h3-container">
</prop:Decorator.PreTagText>
<prop:Decorator.PostTagText>
<!-- Properly close the tag -->
</div>
</prop:Decorator.PostTagText>
</com:THeader3>
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
Class hierarchy
Author: Brad Anderson <javalizard@gmail.com>Since: 3.2
public
|
__construct(TWebControl $control[, bool $onlyinternal = false ]) : mixed
Constructor.
Initializes the control . |
public
|
ensureTemplateDecoration([TComponent $sender = null ][, null|mixed $param = null ]) : bool
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
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
instantiate([null|mixed $outercontrol = null ]) : mixed
This is a framework call. The Text decoration can't
influence the object hierarchy because they are rendered into into the writer directly.
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
|
renderPostContentsText(TTextWriter $writer) : mixed
This method places the post contents text into the {@see \Prado\IO\TTextWriter}
|
public
|
renderPostTagText(TTextWriter $writer) : mixed
This method places the post tag text into the {@see \Prado\IO\TTextWriter}
|
public
|
renderPreContentsText(TTextWriter $writer) : mixed
This method places the pre contents text into the {@see \Prado\IO\TTextWriter}
|
public
|
renderPreTagText(TTextWriter $writer) : mixed
This method places the pre tag text into the {@see \Prado\IO\TTextWriter}
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
\Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |