The missing Joomla™ reference for extension developers
Copyright © 2022-2024 Nikolaos Dionysopoulos
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
—
This work is not affiliated with or endorsed by the Joomla! Project. It is not supported or warranted by the Joomla! Project or Open Source Matters. The Joomla! logo is used under a limited license granted by Open Source Matters, the trademark holder in the United States and other countries.
—
All code found in the code samples in this book is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This sample program code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this sample program code; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
January 2024
Abstract
Developing Joomla extensions is fun and fulfilling. However, its API evolves to better suit the changing times and PHP best practices. When Joomla 4 came out with its richer, brand new API there was no documentation to tell developers how to update and keep developing their extensions. Moreover, over a decade of API stagnation and lack of documentation led developers to complacency, bad code, and unmaintainable code. This book aims to distill my experience writing Joomla software since 2006 and includes some useful background on how some features were decided, how they are meant to be used, and where they fit in the larger picture of writing efficient, maintainable code. This is neither a tutorial nor a reference book. It's more of a practical guide through the Joomla extensions development API.
This book covers development of Joomla! extensions under Joomla versions 4 and 5.
Table of Contents
- Introduction
- 1. Basic concepts
- 2. Components
- The Joomla MVC: an introduction
- Joomla 3 MVC vs Joomla 4 MVC
- The lifetime of a component
- Directory structure
- Service provider
- Extension class
- Dispatcher
- Namespaces and MVC
- The MVCFactory
- Models
- Controllers
- Views
- Tables
- HTML helper service
- Categories
- Router
- Dashboard
- The installation script
- Component menus
- Passing data from the backend to the JavaScript on the page
- Language files
- Mail Templates
- The CLI application
- The API application
- Integration with Scheduled Tasks
- Custom fields
- 3. Plugins
- 4. Modules
- 5. General advice and code magic
- A. GNU Free Documentation License
- B. GNU General Public License