## Class TTheme

Description

Implements interfaces:

- ITheme

TTheme class

TTheme represents a particular theme. It is merely a collection of skins that are applicable to the corresponding controls.

Each theme is stored as a directory and files under that directory. The theme name is the directory name. When TTheme is created, the files whose name has the extension ".skin" are parsed and saved as controls skins.

A skin is essentially a list of initial property values that are to be applied to a control when the skin is applied. Each type of control can have multiple skins identified by the SkinID. If a skin does not have SkinID, it is the default skin that will be applied to controls that do not specify particular SkinID.

Whenever possible, TTheme will try to make use of available cache to save the parsing time.

To apply a theme to a particular control, call applySkin.

- since: 3.0
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/TThemeManager.php (line 166)

    TComponent
       |
       --TApplicationComponent
          |
          --TTheme

Class Constant Summary
SKIN_FILE_EXT = '.skin'
THEME_CACHE_PREFIX = 'prado:theme:'
Method Summary
TTheme __construct (string $themePath, string $themeUrl)
boolean applySkin (TControl $control)
array getJavaScriptFiles ()
string getName ()
array getStyleSheetFiles ()
Methods
Constructor __construct (line 207)

Constructor.

- access: public
- throws: TConfigurationException if theme path does not exist or any parsing error of the skin files

TTheme __construct (string $themePath, string $themeUrl)

- string $themePath: theme path
- string $themeUrl: theme URL

applySkin (line 312)

Applies the theme to a particular control.

The control's class name and SkinID value will be used to identify which skin to be applied. If the control's SkinID is empty, the default skin will be applied.

- return: if a skin is successfully applied
- access: public
- throws: TConfigurationException if any error happened during the skin application

boolean applySkin (TControl $control)

- TControl $control: the control to be applied with a skin

getJavaScriptFiles (line 364)

- return: list of Javascript files (URL) in the theme
- access: public

array getJavaScriptFiles ()
getName (line 298)

- return: theme name
- access: public

string getName ()
getStyleSheetFiles (line 356)

- return: list of CSS files (URL) in the theme
- access: public

array getStyleSheetFiles ()

#### Inherited Methods

Inherited From TApplicationComponent

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

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> 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
SKIN_FILE_EXT = '.skin' (line 175)

Extension name of skin files

THEME_CACHE_PREFIX = 'prado:theme:' (line 171)

prefix for cache variable name used to store parsed themes

Documentation generated on Mon, 01 May 2006 23:04:56 -0400 by phpDocumentor 1.3.0RC4