0

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

3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.