Class \Prado\Util\TParameterModule
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 \Prado\Util\setParameterFile 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" ... />
<parameter id="param3" Class="MyDataObject" Property1="Value1" Property2="Value2" ... />
</parameters>
In addition, any content enclosed within the module tag is also treated as parameters, e.g.,
<module class="Prado\Util\TParameterModule">
<parameter id="param1" value="paramValue1" />
<parameter id="param2" Property1="Value1" Property2="Value2" ... />
<parameter id="param3" Class="MyDataObject" Property1="Value1" Property2="Value2" ... />
</module>
If a parameter is defined both in the external file and within the module tag, the former takes precedence.
When a parameter has an Class Attribute, the parameter is instanced as an object of the specified class and the attribute=value pairs are then set on the object.
Class hierarchy
- \Prado\Util\TParameterModule
- \Prado\TModule implements IModule
- \Prado\TApplicationComponent
- \Prado\TComponent
Author: Carl G. Mathisen <carlgmathisen@gmail.com>
Since: 3.0
public
|
|
public
|
|
public
|
|
protected
|
\Prado\TApplicationComponent::FX_CACHE_FILE, \Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |