Class Module

Description

Module Class

This is a parent class that all PICKLES modules should be extending. Each module can specify it's own meta data and whether or not a user must be properly authenticated to view the page. Currently any pages without a template are treated as pages being requested via AJAX and the return will be JSON encoded. In the future this may need to be changed out for logic that allows the requested module to specify what display type(s) it can use.

Located in /classes/Module.php (line 28)

Object
   |
   --Module
Variable Summary
object $cache
object $db
string, $description
string, $engine
string $hash
string, $keywords
string $method
boolean, $private
boolean, $secure
boolean, $security
boolean, $session
string, $template
string, $title
Method Summary
Module __construct ([boolean $autorun = false])
boolean setRequest (array $request)
void __default ()
mixed __get (string $name)
void __set (string $name, mixed $value)
Variables
object $cache = null (line 36)

Cache Object

  • access: protected
object $db = null (line 44)

Database Object

  • access: protected
string, $description = null (line 60)

Meta Description

  • var: null by default
  • access: protected
string, $engine = DISPLAY_PHP (line 139)

Default Display Engine

Defaults to PHP but could be set to JSON, XML or RSS. Value is overwritten by the config value if not set by the module.

  • var: null by default
  • access: protected
string $hash = null (line 128)

Hash

Whether or not to validate the security hash. Boolean true will indicate using the name of the module as the hash, a string value will use the value instead.

  • var: or boolean, null by default
  • access: protected
string, $keywords = null (line 68)

Meta Keywords (comma separated)

  • var: null by default
  • access: protected
string $method = null (line 116)

Method

Request methods that are allowed to access the module.

  • var: or array, null by default
  • access: protected
boolean, $private = false (line 88)

Private

Whether or not the page can be accessed directly.

  • var: false by default
  • access: protected
boolean, $secure = null (line 78)

Secure

Whether or not the page should be loaded via SSL.

  • var: null by default
  • access: protected
boolean, $security = null (line 96)

Security Settings

  • var: null by default
  • access: protected
boolean, $session = null (line 106)

Session

Whether or not a session should be established.

  • var: null by default
  • access: protected
string, $template = 'index' (line 151)

Default Template

Defaults to null but could be set to any valid template basename. The value is overwritten by the config value if not set by the module. The display engine determines what the file extension should be.

  • var: null by default
  • access: protected
string, $title = null (line 52)

Page Title

  • var: null by default
  • access: protected
Methods
Constructor __construct (line 163)

Constructor

The constructor does nothing by default but can be passed a boolean variable to tell it to automatically run the __default() method. This is typically used when a module is called outside of the scope of the controller (the registration page calls the login page in this manner.

  • access: public
Module __construct ([boolean $autorun = false])
  • boolean $autorun: optional flag to autorun __default()
setRequest (line 235)

Sets the Request

  • return: whether or not the assignment was successful
  • access: public
boolean setRequest (array $request)
  • array $request: data to be loaded into the request variable
__default (line 185)

Default "Magic" Method

This function is overloaded by the module. The __default() method is where you want to place any code that needs to be executed at runtime. The reason the code isn't in the constructor is because the module must be instantiated before the code is executed so that the controller script is aware of the authentication requirements.

  • access: public
void __default ()
__get (line 212)

Magic Getter Method

Attempts to load the module variable. If it's not set, will attempt to load from the config.

  • return: value of the variable or boolean false
  • access: public
mixed __get (string $name)
  • string $name: name of the variable requested
__set (line 198)

Magic Setter Method

Prohibits the direct modification of module variables.

  • access: public
void __set (string $name, mixed $value)
  • string $name: name of the variable to be set
  • mixed $value: value of the variable to be set

Documentation generated on Wed, 03 Oct 2012 17:46:05 -0400 by phpDocumentor 1.4.4