Back to ExtensionManagerTrait class

Method bootModule

public \Joomla\CMS\Extension\ModuleInterface
bootModule
(mixed $module, mixed $applicationName)
Boots the module with the given name.
Parameters
  • string $module The module to boot
  • string $applicationName The application name
Returns
  • \Joomla\CMS\Extension\ModuleInterface
Since
  • 4.0.0

Method bootModule - Source code

/**
 * Boots the module with the given name.
 *
 * @param   string  $module           The module to boot
 * @param   string  $applicationName  The application name
 *
 * @return  ModuleInterface
 *
 * @since   4.0.0
 */
public function bootModule($module, $applicationName) : ModuleInterface
{
    // Normalize the module name
    $module = strtolower(str_replace('mod_', '', $module));
    // Path to to look for services
    $path = JPATH_SITE . '/modules/mod_' . $module;
    if ($applicationName === 'administrator') {
        $path = JPATH_ADMINISTRATOR . '/modules/mod_' . $module;
    }
    return $this->loadExtension(ModuleInterface::class, $module, $path);
}