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,

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

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

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

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

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

TComponent
   |
   --TApplicationComponent
      |
      --TModule
         |
         --TParameterModule
Class Constant Summary
 PARAM_FILE_EXT = '.xml'
Method Summary
string getParameterFile ()
void init (mixed $config)
void loadParameters (mixed $config)
void setParameterFile (string $value)
Methods
getParameterFile (line 154)
  • return: the parameter file path
  • access: public
string getParameterFile ()
init (line 61)

Initializes the module by loading parameters.

  • access: public
void init (mixed $config)
  • mixed $config: content enclosed within the module tag

Redefinition of:
TModule::init()
Initializes the module.
loadParameters (line 99)

Loads parameters into application.

  • throws: TConfigurationException if the parameter file format is invalid
  • access: protected
void loadParameters (mixed $config)
  • mixed $config: XML of PHP representation of the parameters
setParameterFile (line 165)
  • throws: TConfigurationException if the file is invalid
  • throws: TInvalidOperationException if the module is initialized
  • access: public
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::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()
Class Constants
PARAM_FILE_EXT = '.xml' (line 53)
  • deprecated: since 3.2

Documentation generated on Mon, 25 Jun 2012 14:38:53 +0200 by phpDocumentor 1.4.3