PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TTheme

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 TTheme::applySkin().

TComponent
Extended by TApplicationComponent
Extended by TTheme implements ITheme
Package: System\Web\UI
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Web/UI/TThemeManager.php
Methods summary
public
# __construct( string $themePath, string $themeUrl )

Constructor.

Constructor.

Parameters

$themePath
string
theme path
$themeUrl
string
theme URL

Throws

TConfigurationException
if theme path does not exist or any parsing error of the skin files

Overrides

TComponent::__construct()
public string
# getName( )

Returns

string
theme name
protected
# setName( string $value )

Parameters

$value
string
theme name
public string
# getBaseUrl( )

Returns

string
the URL to the theme folder (without ending slash)
protected
# setBaseUrl( string $value )

Parameters

$value
string
the URL to the theme folder
public string
# getBasePath( )

Returns

string
the file path to the theme folder
protected
# setBasePath( string $value )

Parameters

$value
string
tthe file path to the theme folder
public array
# getSkins( )

Returns

array
list of skins for the theme
protected
# setSkins( array $value )

Parameters

$value
array
list of skins for the theme
public boolean
# applySkin( TControl $control )

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.

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.

Parameters

$control
TControl
the control to be applied with a skin

Returns

boolean
if a skin is successfully applied

Throws

TConfigurationException
if any error happened during the skin application

Implementation of

ITheme::applySkin()
public array
# getStyleSheetFiles( )

Returns

array
list of CSS files (URL) in the theme
protected
# setStyleSheetFiles( array $value )

Parameters

$value
array
list of CSS files (URL) in the theme
public array
# getJavaScriptFiles( )

Returns

array
list of Javascript files (URL) in the theme
protected
# setJavaScriptFiles( array $value )

Parameters

$value
array
list of Javascript files (URL) in the theme
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants summary
string THEME_CACHE_PREFIX 'prado:theme:'
#

prefix for cache variable name used to store parsed themes

prefix for cache variable name used to store parsed themes

string SKIN_FILE_EXT '.skin'
#

Extension name of skin files

Extension name of skin files

Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO