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().

Updated on 24 November 2026 29 copies 126 views
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.

Direct Engineering

Have a Joomla project or technical challenge in mind?

From architectural diagnosis to production deployment, directly with the engineer.