- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml
Classes:
TBrowserLogRoute
TDataFieldAccessor
TDateTimeStamp
TDbLogRoute
TEmailLogRoute
TFileLogRoute
TFirebugLogRoute
TFirePhpLogRoute
TLogger
TLogRoute
TLogRouter
TParameterModule
TSimpleDateFormatter
TVarDumper

Keyword

# Class TParameterModule

    TComponent
       |
       --TApplicationComponent
          |
          --TModule
             |
             --TParameterModule

TParameterModule class

TParameterModule enables loading application parameters from external storage other than the application configuration. To load parameters from an XML file, configure the module by setting its ParameterFile property. Note, the property only accepts a file path in namespace format with file extension being '.xml'. The file format is as follows, which is similar to the parameter portion in an application configuration,

     <parameters>
       <parameter id="param1" value="paramValue1" />
       <parameter id="param2" Property1="Value1" Property2="Value2" ... />
     </parameters>

In addition, any content enclosed within the module tag is also treated as parameters, e.g.,

     <module class="System.Util.TParameterModule">
       <parameter id="param1" value="paramValue1" />
       <parameter id="param2" Property1="Value1" Property2="Value2" ... />
     </module>

If a parameter is defined both in the external file and within the module tag, the former takes precedence.

Since: 3.0
Author: Qiang Xue <qiang.xue@gmail.com>

Method Summary
string | getParameterFile ()
void | init ( TXmlElement $config) Initializes the module by loading parameters.
protected void | loadParameters ( TXmlElement $xmlNode) Loads parameters into application.
void | setParameterFile ( string $value)

Methods Inherited From TModule
TModule::getID(), TModule::init(), TModule::setID()

Methods Inherited From TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()

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

Constant Summary
string | PARAM_FILE_EXT |

Method Details

## getParameterFile

public string getParameterFile | ()

Output
string | the parameter file path
Exception

## init

public void init | (TXmlElement $config )

Initializes the module by loading parameters.

Input
TXmlElement | $config | content enclosed within the module tag
Output
Exception

## loadParameters

protected void loadParameters | (TXmlElement $xmlNode )

Loads parameters into application.

Input
TXmlElement | $xmlNode | XML representation of the parameters
Output
Exception
throws | TConfigurationException if the parameter file format is invalid

## setParameterFile

public void setParameterFile | (string $value )

Input
string | $value | the parameter file path. It must be in namespace format and the file extension is '.xml'.
Output
Exception
throws | TInvalidOperationException if the module is initialized
throws | TConfigurationException if the file is invalid

Constant Details

### PARAM_FILE_EXT

#### Type:

string

#### Value:

'.xml'