Class THead

Description

THead class

THead displays a head element on a page. It displays the content enclosed in its body and the page title set by the Title 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 MetaTags property. You can add a meta object to the collection in code dynamically, or add it in template using the following syntax,

  1. <com:THead>
  2. <com:TMetaTag HttpEquiv="Pragma" Content="no-cache" />
  3. <com:TMetaTag Name="keywords" Content="Prado" />
  4. </com:THead>

Note, TPage has a property TPage::getHead that refers to the THead control currently on the page. A page can have at most once 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.

  • since: 3.0
  • version: $Id: THead.php 1509 2006-11-25 20:51:43Z xue $
  • author: Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/THead.php (line 44)

TComponent
   |
   --TApplicationComponent
      |
      --TControl
         |
         --THead
Method Summary
void addParsedObject (string|TComponent $object)
string getBaseUrl ()
string getShortcutIcon ()
string getTitle ()
void onInit (TEventParameter $param)
void render (THtmlWriter $writer)
void setBaseUrl (string $url)
void setShortcutIcon (string $url)
void setTitle (string $value)
Methods
addParsedObject (line 72)

Processes an object that is created during parsing template.

This method adds TMetaTag components into the MetaTags collection of the head control.

void addParsedObject (string|TComponent $object)
  • string|TComponent $object: text string or component parsed and instantiated in template

Redefinition of:
TControl::addParsedObject()
Adds the object instantiated on a template to the child control collection.
getBaseUrl (line 102)
  • return: base URL of the page. This URL is rendered as the 'href' attribute of <base> tag. Defaults to ''.
  • access: public
string getBaseUrl ()
getMetaTags (line 134)
  • return: meta tag collection
  • access: public
TMetaTagCollection getMetaTags ()
getShortcutIcon (line 118)
  • return: the URL for the shortcut icon of the page. Defaults to ''.
  • access: public
string getShortcutIcon ()
getTitle (line 83)
  • return: the page title.
  • access: public
string getTitle ()
onInit (line 59)

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.

  • access: public
void onInit (TEventParameter $param)
  • TEventParameter $param: event parameter to be passed to the event handlers

Redefinition of:
TControl::onInit()
This method is invoked when the control enters 'OnInit' stage.
render (line 148)

Renders the head control.

  • access: public
void render (THtmlWriter $writer)
  • THtmlWriter $writer: the writer for rendering purpose.

Redefinition of:
TControl::render()
Renders the control.
setBaseUrl (line 110)
  • access: public
void setBaseUrl (string $url)
  • string $url: base URL of the page. This URL is rendered as the 'href' attribute of <base> tag.
setShortcutIcon (line 126)
  • access: public
void setShortcutIcon (string $url)
  • string $url: the URL for the shortcut icon of the page.
setTitle (line 94)

Sets the page title.

This title will be rendered only if the TPage::getTitle property of the page is empty.

  • access: public
void setTitle (string $value)
  • string $value: the page title.

Inherited Methods

Inherited From TControl

TControl::__construct()
TControl::addedControl()
TControl::addParsedObject()
TControl::addToPostDataLoader()
TControl::applyStyleSheetSkin()
TControl::autoBindProperty()
TControl::autoDataBindProperties()
TControl::bindProperty()
TControl::broadcastEvent()
TControl::bubbleEvent()
TControl::clearChildState()
TControl::clearControlState()
TControl::clearNamingContainer()
TControl::clearViewState()
TControl::convertUniqueIdToClientId()
TControl::createChildControls()
TControl::createControlCollection()
TControl::dataBind()
TControl::dataBindChildren()
TControl::dataBindProperties()
TControl::ensureChildControls()
TControl::findControl()
TControl::findControlsByID()
TControl::findControlsByType()
TControl::focus()
TControl::getAdapter()
TControl::getAllowChildControls()
TControl::getAttribute()
TControl::getAttributes()
TControl::getChildControlsCreated()
TControl::getClientID()
TControl::getControls()
TControl::getControlStage()
TControl::getControlState()
TControl::getCustomData()
TControl::getEnabled()
TControl::getEnableTheming()
TControl::getEnableViewState()
TControl::getHasAdapter()
TControl::getHasAttributes()
TControl::getHasChildInitialized()
TControl::getHasControls()
TControl::getHasInitialized()
TControl::getHasLoaded()
TControl::getHasLoadedPostData()
TControl::getHasPreRendered()
TControl::getID()
TControl::getNamingContainer()
TControl::getPage()
TControl::getParent()
TControl::getRegisteredObject()
TControl::getSkinID()
TControl::getSourceTemplateControl()
TControl::getTemplateControl()
TControl::getUniqueID()
TControl::getViewState()
TControl::getVisible()
TControl::hasAttribute()
TControl::initRecursive()
TControl::isDescendentOf()
TControl::isObjectRegistered()
TControl::loadRecursive()
TControl::loadState()
TControl::loadStateRecursive()
TControl::onDataBinding()
TControl::onInit()
TControl::onLoad()
TControl::onPreRender()
TControl::onUnload()
TControl::preRenderRecursive()
TControl::raiseBubbleEvent()
TControl::registerObject()
TControl::removeAttribute()
TControl::removedControl()
TControl::render()
TControl::renderChildren()
TControl::renderControl()
TControl::saveState()
TControl::saveStateRecursive()
TControl::setAdapter()
TControl::setAttribute()
TControl::setChildControlsCreated()
TControl::setControlStage()
TControl::setControlState()
TControl::setCustomData()
TControl::setEnabled()
TControl::setEnableTheming()
TControl::setEnableViewState()
TControl::setID()
TControl::setPage()
TControl::setSkinID()
TControl::setTemplateControl()
TControl::setViewState()
TControl::setVisible()
TControl::trackViewState()
TControl::traverseChildControls()
TControl::unbindProperty()
TControl::unloadRecursive()
TControl::unregisterObject()
TControl::__get()

Inherited From TApplicationComponent

TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()

Inherited From TComponent

TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__get()
TComponent::__set()
Class Constants

Documentation generated on Mon, 21 Apr 2008 11:35:04 -0400 by phpDocumentor 1.3.0RC4