- Details
To create a simple module in Joomla 4 we will have to follow the following steps:
We will create a new directory called mod_example. In this directory we will create the first file named mod_example.php. This is the main file that will be accessed by Joomla and it will perform all the routines necessary to display the module.
In this file we will write the following source code:
<?php
defined('_JEXEC') or die;
use Joomla\CMS\Helper\ModuleHelper;
require ModuleHelper::getLayoutPath('mod_exemplu', $params->get('layout', 'default'));