$p._callInit() – initialization helper

Helper method to call all init() methods of sub-objects of a passed code object.

Usage
$p._callInit(obj, pre)
Member of:
$p (core)
Parameters:
obj – an object containing sub-objects which in turn contain _init() and/or init() functions (required)
pre – if true, the _init() methods will be called, otherwise init() (optional, default: true)

Notes:

Example

This is an example of how the console init() implementation may look like:

$p.console.init = function(parent) {
  this.setTarget(document.getElementById('console'));
}

As this refers to $p.console, it can be used as a shortcut to the setTarget() method.

In this example, parent refers to $p, though it could be omitted, as it is not used here.

See also