function moopapi_register in Module Object Oriented Programming API 6.2
Same name and namespace in other branches
- 6 moopapi.module \moopapi_register()
- 7.2 moopapi.module \moopapi_register()
- 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 - Implementation of hook_init().
File
- ./
moopapi.module, line 146
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,..
$app_name = ucfirst(strtolower($app));
$classes[$app_name] = !empty($decorators) ? array_filter($decorators, 'ucfirst') : $app_name;
}
return $classes;
}