Class \Prado\Web\UI\WebControls\THead
THead displays a head element on a page. It displays the content enclosed in its body and the page title set by the \Prado\Web\UI\WebControls\setTitle property. In addition, stylesheets and JavaScripts registered via TClientScriptManager::registerStyleSheet, TClientScriptManager::registerStyleSheetFile TClientScriptManager::registerHeadJavaScript, and TClientScriptManager::registerHeadJavaScriptFile will also be displayed in the head. THead also manages and displays meta tags through its \Prado\Web\UI\WebControls\getMetaTags property. You can add a meta object to the collection in code dynamically, or add it in template using the following syntax,
<com:THead>
<com:TMetaTag HttpEquiv="Pragma" Content="no-cache" />
<com:TMetaTag Name="keywords" Content="Prado" />
</com:THead>
Note, TPage has a property \Prado\Web\UI\TPage::getHead that refers to the THead control currently on the page. A page can have at most one THead control. Although not required, it is recommended to place a THead on your page. Without a THead on the page, stylesheets and javascripts in the current page theme will not be rendered.
Class hierarchy
- \Prado\Web\UI\WebControls\THead
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.0
public
|
addParsedObject(TComponent|string $object) : mixed
Processes an object that is created during parsing template.
This method adds TMetaTag components into the \Prado\Web\UI\WebControls\getMetaTags collection of the head control. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
onInit(TEventParameter $param) : mixed
Registers the head control with the current page.
This method is invoked when the control enters 'Init' stage. The method raises 'Init' event. If you override this method, be sure to call the parent implementation so that the event handlers can be invoked. |
public
|
|
public
|
|
public
|
|
public
|
setTitle(string $value) : mixed
Sets the page title.
This title will be rendered only if the \Prado\Web\UI\TPage::getTitle property of the page is empty. |