## Class TParameterModule

Description

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
- version: $Id: TParameterModule.php 2541 2008-10-21 15:05:13Z qiang.xue $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Util/TParameterModule.php (line 47)

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

Class Constant Summary
PARAM_FILE_EXT = '.xml'
Method Summary
string getParameterFile ()
void init (TXmlElement $config)
void loadParameters (TXmlElement $xmlNode)
void setParameterFile (string $value)
Methods
getParameterFile (line 124)

- return: the parameter file path
- access: public

string getParameterFile ()
init (line 57)

Initializes the module by loading parameters.

- access: public

void init (TXmlElement $config)

- TXmlElement $config: content enclosed within the module tag

Redefinition of:

TModule::init()
  Initializes the module.

loadParameters (line 87)

Loads parameters into application.

- access: protected
- throws: TConfigurationException if the parameter file format is invalid

void loadParameters (TXmlElement $xmlNode)

- TXmlElement $xmlNode: XML representation of the parameters

setParameterFile (line 135)

- access: public
- throws: TInvalidOperationException if the module is initialized
- throws: TConfigurationException if the file is invalid

void setParameterFile (string $value)

- string $value: the parameter file path. It must be in namespace format and the file extension is '.xml'.

#### Inherited Methods

Inherited From TModule

> TModule::getID()
> TModule::init()
> TModule::setID()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

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

Class Constants
PARAM_FILE_EXT = '.xml' (line 49)

Documentation generated on Mon, 22 Feb 2010 12:18:23 +0000 by phpDocumentor 1.3.0RC4