PHP
Joomla! 6
Joomla! 5
Joomla! 3 (Legacy)
Module
Basic
Read Module Parameters Inside the Module
Reads module XML configuration values inside the module Dispatcher or tmpl layout files.
modules/mod_example/tmpl/default.php
<?php
declare(strict_types=1);
// Dentro de tmpl/default.php ou override do módulo
/** @var \Joomla\Registry\Registry $params */
$param = (string) $params->get('paramName', 'defaultValue');
Works in tmpl/default.php and inside Dispatcher::getLayoutData() via $data['params'].
modules/mod_example/tmpl/default.php
<?php
$param = $params->get('paramName', 'defaultValue');
Standard $params access in Joomla 3 modules.
Technical explanation and best practices
In modern Joomla 5 and 6 modules built on AbstractModuleDispatcher, the $params Registry object is automatically exposed inside getLayoutData() and all tmpl/*.php layouts.