You are here

function moopapi_register in Module Object Oriented Programming API 7.2

Same name and namespace in other branches
  1. 6.2 moopapi.module \moopapi_register()
  2. 6 moopapi.module \moopapi_register()
  3. 7 moopapi.module \moopapi_register()

OOP modules must register themselves before they can be initialized Modules can use this API function during boot and init hooks to register themselves so moopapi can integrate them with the framework.

@staticvar array $classes

Parameters

string $app:

array $decorators:

Return value

array

2 calls to moopapi_register()
MoopapiWebTestCase::testRegister in tests/moopapi.test
moopapi_init in ./moopapi.module
Implements of hook_init().

File

./moopapi.module, line 204

Code

function moopapi_register($app = NULL, array $decorators = array()) {
  static $classes = array();
  if ($app !== NULL && !isset($classes[$app])) {

    // Unify all classnames as follows: Application, Foo, Bar,...
    $classes[ucfirst(strtolower($app))] = array_filter($decorators, 'ucfirst');
  }
  return $classes;
}