本文整理汇总了PHP中MainController::ModuleList方法的典型用法代码示例。如果您正苦于以下问题:PHP MainController::ModuleList方法的具体用法?PHP MainController::ModuleList怎么用?PHP MainController::ModuleList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainController
的用法示例。
在下文中一共展示了MainController::ModuleList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadModules
/**
* Load and initialize any modules from a list
*
* @param array $ModuleList List of modules. $key is name, $value is path
*/
public static function loadModules()
{
global $NAVBAR;
global $HTMLHead;
self::$ModuleList = self::getModulesFromPath(CODON_MODULES_PATH);
if (empty(self::$ModuleList)) {
Debug::showCritical('No modules were found in module path! (' . CODON_MODULES_PATH . ')');
return;
}
self::$listSize = sizeof(self::$ModuleList);
self::$keys = array_keys(self::$ModuleList);
for ($i = 0; $i < self::$listSize; $i++) {
$ModuleName = self::$keys[$i];
$ModuleController = self::$ModuleList[$ModuleName];
if (file_exists($ModuleController)) {
include_once $ModuleController;
if (class_exists($ModuleName)) {
$ModuleName = strtoupper($ModuleName);
global ${$ModuleName};
${$ModuleName} = new $ModuleName();
${$ModuleName}->init($ModuleName);
// Call the parent constructor
if (self::$activeModule == $ModuleName) {
# Skip it for now, run it last since it's the active
# one, and may overwrite some other parameters
continue;
} else {
ob_start();
self::Run($ModuleName, 'NavBar');
$NAVBAR .= ob_get_clean();
self::Run($ModuleName, 'HTMLHead');
$HTMLHead .= ob_get_clean();
@ob_end_clean();
}
}
}
}
# Run the init tasks
ob_start();
self::Run(self::$activeModule, 'NavBar');
$NAVBAR .= ob_get_clean();
self::Run(self::$activeModule, 'HTMLHead');
$HTMLHead .= ob_get_clean();
@ob_end_clean();
}