Extension development
Building extensions step by step: structure, settings, modules, templates, classes and contributing back.
216 pages
- When to fork, and when not to A fork is a copy you promise to maintain. When a fork is the right answer - an abandoned original, a fix waiting for review, a different direction - and when an override, an issue or a pull request is better.
- With RAD: a template operator in five minutes Use the Template extension wizard to write a working extension with an operator and a fetch function, see every file it writes, fill in the operator's one line, switch it on and use it - with the wizard's real output.
- A theme with the RAD wizard Start a theme with the Design extension wizard of Setup > RAD and grow its skeleton into a real theme - siteaccess, frontend lists, base design, page parts, view templates - with three corrections.
- extension.xml: metadata and dependencies The extension.xml file: the metadata read before ezinfo.php, and the requires, uses and extends dependencies that the Extensions page shows and that decide the loading order.
- eZDebug and logging Write to the debug output and log files from an extension - writeNotice, writeWarning, writeError, writeDebug, timing and accumulators, eZLog::write - and the debug settings.
- Forking on GitHub, step by step Fork an extension's repository on GitHub, clone it, add the original as upstream, work on a branch and install your fork into an Exponential site with Composer, with the commands and what you should see.
- Part 3: The extension developer Part 3 of the book: the anatomy of an extension, one mechanism per chapter, from metadata and settings to modules, operators, datatypes, events, security and tests, followed by step-by-step tutorials.
- Siteaccess settings A siteaccess is one face of an installation - a public site, a language, the administration. How a request picks its siteaccess, which settings define one, and a complete commented example of a public siteaccess.
- Tags and releases are permanent Why a pushed tag and a published release can never be moved, replaced or re-cut - Packagist and every installation keep what they first saw - and what to do instead when a release went out wrong.
- Taking inventory of an old extension Find out what an old extension contains and what will need work before you change a line: files, settings, PHP entry points, JavaScript, inline code, database tables, with the commands to list each.
- The tools you need The short list of tools for extension development with Exponential - a terminal, PHP 8, Composer 2, Git, a text editor, a browser with developer tools, xmllint and PHPUnit - with the command that checks each one.
- With RAD: a datatype The Datatype wizard writes a rating datatype: form, storage and abilities, the files, what you still write, and two corrections to make by hand, from the wizard's real output.
- Activating an extension Switching an extension on for the installation or one siteaccess, what it writes, and the steps that make the running site see it: autoloads, caches, PHP-FPM and Velocity.
- A theme by hand Build the smallest complete theme file by file - metadata, the design registration, a siteaccess, a pagelayout, a stylesheet and an override - and check each step, so you know what every file of a theme does.
- Bumping ezinfo.php and extension.xml Every release raises the version inside the extension - ezinfo.php, extension.xml, and composer.json or filelist.md5 where present - to exactly the release's number, in the commit the tag points at, never after.
- eZDB: the database layer The eZDB methods extensions use - arrayQuery() with offset and limit, query(), escapeString(), generateSQLINStatement(), transactions, lastSerialID(), portable SQL helpers - and safe values.
- Keeping a fork in sync with its source Bring the original's new commits into your fork with git fetch and merge or rebase, resolve conflicts, and keep your own changes small so syncing stays easy - with the commands and a routine.
- Part 4: Upgrading an old extension to Exponential 6 Part 4 of the book: bring an old extension up to Exponential 6, from the inventory and PHP 8 fixes to CSP, jQuery 4, admin4 styling, metadata and tests, with real before and after examples.
- PHP 8 errors that stop old code The PHP 8 changes that turn old extension code into fatal errors - bare-word constants, static calls, wrong argument types, count() on null, incompatible signatures - with how to find and fix each one.
- Settings that live in an extension Keep a site's configuration in a settings extension under version control - the folder layout, global and per-siteaccess settings, moving existing settings in with exp:ini move-all, and what stays out (secrets).
Documentation license
This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.
Exponential Copyright © 1998-2026 Exponential Foundation and 7x