In Joomla 3, I get module params with this code:

// Create the Application
$app = JFactory::getApplication('site');

$module = JModuleHelper::getModule('mod_dev');
$presetParams = new JRegistry($module->params);

$fontSize = $presetParams['fontSize'];

In Joomla 4, I start with this code:

// Boot the DI container.
$container = \Joomla\CMS\Factory::getContainer();

// Alias the session service key to the web session service.
$container->alias(\Joomla\Session\SessionInterface::class, 'session.web.site');

// Get the application.
$app = $container->get(\Joomla\CMS\Application\SiteApplication::class);


$module = JModuleHelper::getModule('mod_dev');

stopped working.

How can I access module params from external php file using the Joomla framework?

1 Answer 1


Could you explain what you mean by external php file? It may be something you can do with the new console package - tricky to set up but very good for cron jobs. Also, how do you distinguish between multiple module instances?


Your Answer

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

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