PHP Class Prado\Web\UI\TTheme

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 {@link applySkin}.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends Prado\TApplicationComponent, implements Prado\Web\UI\ITheme
Datei anzeigen Open project: pradosoft/prado

Public Methods

Method Description
__construct ( $themePath, $themeUrl ) Constructor.
applySkin ( $control ) : boolean Applies the theme to a particular control.
getBasePath ( ) : string
getBaseUrl ( ) : string
getJavaScriptFiles ( ) : array
getName ( ) : string
getSkins ( ) : array
getStyleSheetFiles ( ) : array

Protected Methods

Method Description
setBasePath ( $value )
setBaseUrl ( $value )
setJavaScriptFiles ( $value )
setName ( $value )
setSkins ( $value )
setStyleSheetFiles ( $value )

Method Details

__construct() public method

Constructor.
public __construct ( $themePath, $themeUrl )

applySkin() public method

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.
public applySkin ( $control ) : boolean
return boolean if a skin is successfully applied

getBasePath() public method

public getBasePath ( ) : string
return string the file path to the theme folder

getBaseUrl() public method

public getBaseUrl ( ) : string
return string the URL to the theme folder (without ending slash)

getJavaScriptFiles() public method

public getJavaScriptFiles ( ) : array
return array list of Javascript files (URL) in the theme

getName() public method

public getName ( ) : string
return string theme name

getSkins() public method

public getSkins ( ) : array
return array list of skins for the theme

getStyleSheetFiles() public method

public getStyleSheetFiles ( ) : array
return array list of CSS files (URL) in the theme

setBasePath() protected method

protected setBasePath ( $value )

setBaseUrl() protected method

protected setBaseUrl ( $value )

setJavaScriptFiles() protected method

protected setJavaScriptFiles ( $value )

setName() protected method

protected setName ( $value )

setSkins() protected method

protected setSkins ( $value )

setStyleSheetFiles() protected method

protected setStyleSheetFiles ( $value )