MidCOM PHP Superglobal

From OpenPSA Wiki

(Redirected from MIDCOM PHP Superglobal)
Jump to: navigation, search

The $_MIDCOM superglobal is where MidCOM stores the midcom_application object, the main controlling instance of the MidCOM framework. $_MIDCOM is usually a link to $GLOBALS['midcom'], so the same functionality is available there. See also Midgard PHP Superglobal.

Modifying Style Elements often involves the use of the $_MIDCOM object. For example, get_context_data is used to transport information from Component backend functions to the presentation layer (i.e. the Style Elements).

In OpenPSA 9 and Midgard 2, the use of the $_MIDCOM superglobal is deprecated. Developers should access the functionality with the midcom::get() method instead:

//old syntax:
$_MIDCOM->componentloader->load('org.openpsa.documents');
//new syntax:
midcom::get('componentloader')->load('org.openpsa.documents');

[edit] Structure

Personal tools