Tariqa  3.0
 All Data Structures Namespaces Files Functions Variables Enumerations
mModularApplication Class Reference
Inheritance diagram for mModularApplication:
mApplication mBaseApplication Application

Public Member Functions

 __construct ($application_config)
 addModule ($module, $is_default=false)
 getModules ()
 getTemplatesFolder ()
 getTemplateFilePath ($template_file)

Data Fields

const default_template_file = 'index.html'

Protected Member Functions

 onInitialize ()
 onDestroy ()
 onException ($e)
 onExecuteModule ($module_result, $module_info, $module_template=self::default_template_file, $module_headers=null)

Protected Attributes

 $modules = array()
 $default_module = false
 $template = false
 $base_folder = false

Constructor & Destructor Documentation

__construct ( application_config)

Object Constructor

Parameters:
array$application_configThe application params. The array should be an associative array If you want to send the config path and the config format just send an array like array('path' => 'my_path', 'format' => 'my_format') If you want to send the config array directly, just send an array like array('config' => $my_config)
bool$auto_save_configIf set to true, the application will automatically save the configuration file on exit

Reimplemented from mApplication.

Reimplemented in Application.


Member Function Documentation

addModule ( module,
is_default = false 
)

Add a mModule object to the list of modules of the application

Parameters:
mModule$moduleThe module object
bool$is_defaultIf set to true, set the new module as the default module

Get the list of modules

Returns:
mModule[]
getTemplateFilePath ( template_file) [final]

Returns the full path to a specific template file of the application

Parameters:
string$template_fileTemplate file's name
Returns:
string public
getTemplatesFolder ( ) [final]

Returns the Full path to the templates folder of this application (no trailing slash) public

Returns:
string
onDestroy ( ) [protected]

This method is called last (after the execution of the module) No exception should be thrown within this method, its only goal is to possibly free some resources protected

Reimplemented from mApplication.

onException ( e) [protected]

This method must be implemented in the derivated class This method is called whenever an exceptions occurs in onInitialize or onExecute Please note that the onDestroy() method will still be called afterwards. protected

Reimplemented from mBaseApplication.

Reimplemented in Application.

onExecuteModule ( module_result,
module_info,
module_template = self::default_template_file,
module_headers = null 
) [protected]

This method is called after the execution of a module, allowing the application to draw itself, including module's results. $ Throw an exception in this method to terminate the application protected

Parameters:
string$module_resultsThe resulting output of the module's execution
array$module_infoAn indexed array of strings containing informations about the module
string$module_templateDefault template file (default = index.html)
array | null$module_headersNull or headers set by the module
onInitialize ( ) [protected]

It is called prior to the execution of the module Throw an Exception from this method to immediatelly stop the application (in which case onDestroy() will be gracefuly called) protected

Reimplemented from mApplication.

Reimplemented in Application.


Field Documentation

$base_folder = false [protected]
$default_module = false [protected]

The index of the default module, in the array of modules

$modules = array() [protected]
$template = false [protected]
const default_template_file = 'index.html'

The documentation for this class was generated from the following file: