Understanding Joomla’s plugin file structure
Since Joomla! 4, plugins follow the same architecture as modules and components. The immediate result of this is that Joomla! 4 loads much faster than previous versions of Joomla!. The disadvantage is that we move from a single file structure to the file-and-folder structure we saw in Chapter 2, when starting our component, and in Chapter 7, when writing our modules.
Our plugins will have the following folder structure:
services
: This file contains theprovider.php
file. This registers the plugin copy of the dependency injection container. This means any service injected with our plugin will not be available automatically to other extensions (unless they inject it). This serves the purpose of isolating the plugin from other parts of the Joomla! execution cycle and making sure it does not affect other parts of the framework.src
: This folder contains the classes we use in our plugin, organized in different folders. It...