Back to ExtensionManagerTrait class

Method bootComponent

public \Joomla\CMS\Extension\ComponentInterface
bootComponent
(mixed $component)
Boots the component with the given name.
Parameters
  • string $component The component to boot.
Returns
  • \Joomla\CMS\Extension\ComponentInterface
Since
  • 4.0.0

Method bootComponent - Source code

/**
 * Boots the component with the given name.
 *
 * @param   string  $component  The component to boot.
 *
 * @return  ComponentInterface
 *
 * @since   4.0.0
 */
public function bootComponent($component) : ComponentInterface
{
    // Normalize the component name
    $component = strtolower(str_replace('com_', '', $component));
    // Path to to look for services
    $path = JPATH_ADMINISTRATOR . '/components/com_' . $component;
    return $this->loadExtension(ComponentInterface::class, $component, $path);
}