Extension development
Building extensions step by step: structure, settings, modules, templates, classes and contributing back.
216 pages
- The Packagist webhook When Packagist shows an old newest version although the tag is on GitHub, the repository is missing its Packagist hook. How to see that, how to set it up, and how to bring the package up to date once.
- With RAD: a design extension The Design extension wizard writes a theme skeleton; then point a siteaccess at the new design and adjust two generated settings, from the wizard's real output.
- .ini.append.php files and keeping settings safe Why override files are PHP, which settings files hold secrets, file modes, what never goes into version control or into an extension, and how to check that settings cannot be read from the web.
- Attribution and copyright notices Where credit goes in an extension - file headers, license files, ezinfo.php Includes, composer.json authors, README credits, Git history - and how to add your name without removing anyone else's.
- Changelogs Write a changelog users can act on - grouped by Added, Updated, Fixed, Removed and Renamed, assembled from the commit messages since the last tag, upgrade notes first - and keep an old extension's changelog.
- Dark mode and design tokens in themes Give a theme one set of design tokens with light and dark values, follow the visitor's system setting, add an optional toggle without inline scripts, and check contrast, as the admin4 design does.
- eZContentObjectTreeNode The node methods extensions use - fetch(), fetchByURLPath(), subTreeByNodeID() and its parameters, subTreeCountByNodeID(), object(), path, URL alias, access - with a tested example.
- Finding the extensions installed on your site Setup > Extensions, Info > About and the command line: what is installed, and which extension is behind a page, a template, a setting or an operator.
- Old-style constructors and static calls PHP 8 no longer runs a method named after its class as the constructor, and stops on instance methods called statically. How to find both in an old extension and fix them without breaking code that calls the old names.
- Part 7: Releasing your extension Part 7 of the book: release an extension so others can rely on it - version numbers, permanent tags, metadata bumps, Composer and Packagist, changelogs, GitHub releases, packages, tests, and a checklist.
- Settings in an extension Settings an extension ships: registration lines in kernel INI files, your own INI file with documented defaults, reading it safely with eZINI, per-siteaccess settings and secrets.
- With RAD: a settings-only extension The Settings extension wizard writes settings and event listeners: its topics, the listener class that is safe by default, and moving existing settings with exp:ini move-all instead.
- Autoloads and class naming How the kernel finds your classes: the autoload arrays, ezpgenerateautoloads.php and what it scans, naming that avoids collisions, and what to do when a class is not found.
- Contributing back with pull requests Send a fix or feature to the kernel or someone else's extension as a pull request: one change per branch, tests, a description of what was broken and how you checked it, and what to do after.
- Distributing a theme Publish a theme others can install - licenses of the code, fonts, icons and images it carries, metadata, Composer, content class packages, screenshots and a README - with a checklist before the first release.
- eZContentClass and its attributes Read content classes and their attributes from PHP - fetchByIdentifier(), classIDByIdentifier(), dataMap(), fetchAttributeByIdentifier(), datatype and content - using identifiers, not IDs.
- GitHub releases and release notes Turn a pushed tag into a GitHub release - title, notes from the changelog, what to attach and what not - with the gh command and the rule that a published release is never edited to change what it delivers.
- Nullable parameters and type declarations Fix the most common PHP 8.4 deprecation, implicitly nullable parameters, and add type declarations to old code safely, with examples from expsite_api, expquery_translator and ezfind.
- Part 8: Reference of built-in features for extension authors Part 8 of the book: a reference of the kernel classes, template features, settings, commands and directories extension authors use most, with signatures taken from the source and links to the full documentation.
- Templates for builders The template language in one chapter - output and escaping, variables with def, set and undef, arrays and hashes, if and foreach, operators and pipes, includes, comments - with examples rendered by the engine.
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