Developing Joomla! 5 Extensions by Carlos M. Cámara Mora

Developing Joomla! 5 Extensions by Carlos M. Cámara Mora

Author:Carlos M. Cámara Mora
Language: eng
Format: epub
Publisher: Packt Publishing Limited
Published: 2023-11-20T00:00:00+00:00


Technical requirements

In this chapter, we will keep improving our Simple Project Manager extension so you will require the following:

Visual Studio Code (or the code editor of your preference)

The Joomla! site we installed in the previous chapters

You’ll find all the code used in this chapter on GitHub: https://github.com/PacktPublishing/Developing-Extensions-for-Joomla-5/tree/chapter07

Understanding the module file structure

Modules in Joomla! are inside the modules folder of our site. In any typical Joomla! installation, this folder is full of folders that belong to the modules. These folder names start with the prefix mod_ to emphasize they are a module. This is not a rule when naming our modules, but Joomla! will add the prefix to the folder name if not present.

Since Joomla! 4, the module architecture has been the same as the component architecture.

So, when calling a module, Joomla! will look for the provider.php file inside the service modules. In the provider.php file, we will register the services we need in our module.

After registering our services, Joomla! looks for our module’s Dispatcher.php file, which will be inside the src/Dispatcher/ folder of our module. We will need a folder structure as follows:

services: This folder contains the provider.php file. This file is like src/component/admin/services/provider.php, and it’s used to register our module into Joomla!. It’s actually the first file that Joomla! will look for when executing our module.

src: This contains our module code, correctly organized in different folders. We may find here the Dispatcher folder or the Helper folder.

tmpl: This contains different layout files for our module. It’s common to have at least one default.php file with our layout.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.