PHP
Joomla! 6
Joomla! 5
Joomla! 3 (Legacy)
Helper / API
Basic
Read Plugin Parameters Outside the Plugin
Fetches and parses the JSON parameters of any published plugin from a module, component or template.
components/com_example/src/Helper/ConfigHelper.php
<?php
declare(strict_types=1);
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Registry\Registry;
$plugin = PluginHelper::getPlugin('editors', 'codemirror');
$param = 'defaultValue';
if ($plugin && isset($plugin->params)) {
$pluginParams = new Registry($plugin->params);
$param = (string) $pluginParams->get('paramName', 'defaultValue');
}
Uses namespaced PluginHelper and Registry with a safe active-plugin check.
components/com_example/src/Helper/ConfigHelper.php
<?php
$plugin = JPluginHelper::getPlugin('editors', 'codemirror');
$pluginParams = new JRegistry();
$pluginParams->loadString($plugin->params);
$param = $pluginParams->get('paramName', 'defaultValue');
Legacy Joomla 3 version using JPluginHelper and JRegistry.
Technical explanation and best practices
When a component, module or template needs to inspect settings of a specific plugin (such as editors/codemirror), call PluginHelper::getPlugin() and wrap $plugin->params in Joomla\Registry\Registry.
Always check that $plugin is non-empty because disabled plugins return an empty array.