Class TTheme

Description

Implements interfaces:

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.

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

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)
string getBasePath ()
string getBaseUrl ()
string getName ()
Methods
Constructor __construct (line 224)

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 346)

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
getBasePath (line 332)
  • return: the file path to the theme folder
  • access: public
string getBasePath ()
getBaseUrl (line 324)
  • return: the URL to the theme folder (without ending slash)
  • access: public
string getBaseUrl ()
getJavaScriptFiles (line 398)
  • return: list of Javascript files (URL) in the theme
  • access: public
array getJavaScriptFiles ()
getName (line 316)
  • return: theme name
  • access: public
string getName ()
getStyleSheetFiles (line 390)
  • 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 192)

Extension name of skin files

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

prefix for cache variable name used to store parsed themes

Documentation generated on Sun, 04 Jun 2006 19:00:34 -0400 by phpDocumentor 1.3.0RC4