PHP
Joomla! 6
Joomla! 5
Joomla! 3 (Legacy)
Helper / API
Basic
Read Any Component Parameters Externally
Reads global options of any component from plugins, modules, CLI scripts or other components using ComponentHelper::getParams().
plugins/system/example/src/Extension/Example.php
<?php
declare(strict_types=1);
use Joomla\CMS\Component\ComponentHelper;
$componentParams = ComponentHelper::getParams('com_example');
$param = (string) $componentParams->get('paramName', 'defaultValue');
Works identically in Site, Administrator and CLI contexts.
plugins/system/example/src/Extension/Example.php
<?php
$app = JFactory::getApplication('site');
$componentParams = $app->getParams('com_example');
$param = $componentParams->get('paramName', 'defaultValue');
Legacy Joomla 3 version via JFactory::getApplication('site')->getParams().
Technical explanation and best practices
ComponentHelper::getParams('com_example') is the cleanest, context-independent way to read global component configuration across Site, Administrator and CLI applications in Joomla 5 and 6.