Class TThemeManager
TThemeManager class
TThemeManager manages the themes used in a Prado application. Themes are stored under the directory specified by the BasePath property. The themes can be accessed via URL BaseUrl. Each theme is represented by a subdirectory and all the files under that directory. The name of a theme is the name of the corresponding subdirectory. By default, the base path of all themes is a directory named "themes" under the directory containing the application entry script. To get a theme (normally you do not need to), call getTheme. TThemeManager may be configured within page service tag in application configuration file as follows, <module id="themes" class="System.Web.UI.TThemeManager" BasePath="Application.themes" BaseUrl="/themes" /> where getCacheExpire, getCacheControl and getBufferOutput are configurable properties of THttpResponse.
| Method Summary |
|
array
|
|
|
string
|
|
|
string
|
|
|
TTheme
|
|
|
void
|
Initializes the module.
|
|
void
|
|
|
void
|
|
| Methods 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()
|
| Method Details |
getAvailableThemes
| public array getAvailableThemes |
() |
| Output |
|
array
| list of available theme names |
| Exception |
|
getBasePath
| public string getBasePath |
() |
| Output |
|
string
| the base path for all themes. It is returned as an absolute path. |
| Exception |
| throws | TConfigurationException if base path is not set and "themes" directory does not exist. |
|
getBaseUrl
| public string getBaseUrl |
() |
| Output |
|
string
| the base URL for all themes. |
| Exception |
| throws | TConfigurationException If base URL is not set and a correct one cannot be determined by Prado. |
|
getTheme
| public TTheme getTheme |
(string $name ) |
| Input |
| string | $name | name of the theme to be retrieved |
| Output |
|
TTheme
| the theme retrieved |
| Exception |
|
init
Initializes the module.
This method is required by IModule and is invoked by application.
| Input |
| TXmlElement | $config | module configuration |
| Output |
| Exception |
|
setBasePath
| public void setBasePath |
(string $value ) |
| Input |
| string | $value | the base path for all themes. It must be in the format of a namespace. |
| Output |
| Exception |
| throws | TInvalidDataValueException if the base path is not a proper namespace. |
|
setBaseUrl
| public void setBaseUrl |
(string $value ) |
| Input |
| string | $value | the base URL for all themes. |
| Output |
| Exception |
|
| Constant Details |
DEFAULT_BASEPATH
default themes base path
Type:
string
Value:
'themes'
|
|