I am using the below joomla code in my custom component.

$module = JModuleHelper::getModule('mod_mycustommodule');
$moduleParams = new Joomla\Registry\Registry($module->params);

It seems 'JModuleHelper' is deprecated from Joomla 4 and would like to know what is the equivalent in Joomla 4 style of coding. Thanks.

1 Answer 1


Use the fully qualified class name which is Joomla\CMS\Helper\ModuleHelper.

To get this information in your IDE, you can run build/stubGenerator.php script via PHP command line. This will generate a stub file of deprecated class aliases and the new classes to use. This is how it looks in VS code:

enter image description here

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .