Part 3: The extension developer
This is the third and largest part of Extension development: the book. It explains, one mechanism per
chapter, how an extension plugs PHP code into the kernel: where the code goes, which setting registers it, the contract
(class and methods, copied from the kernel source), a minimal example that was checked with php -l and, where it is
safe, run with the kernel loaded; how to see that it works; the common mistakes; and the RAD wizard that writes it for
you. The tutorials then build real small extensions step by step.
The anatomy
The shell of an extension
| Chapter | |
|---|---|
| The extension directory layout | every folder name and what the kernel does with it |
| ezinfo.php, extension.xml | who made it, which version, which license, dependencies |
| Activating an extension, Extension load order | switching it on, and who wins |
| composer.json for an extension | installing it with Composer |
| Settings in an extension | your own INI file and reading it |
| Autoloads and class naming | how your classes are found |
Pages and permissions
| Chapter | |
|---|---|
| Modules and views, View parameters | pages with their own address |
| Policy functions and access checks | who may open them |
| View results and the pagelayout | what a view returns |
Templates
| Chapter | |
|---|---|
| Template operators, Fetch functions, Template functions | giving templates new abilities |
Content and processes
| Chapter | |
|---|---|
| Datatypes, Datatype storage, validation and templates | new kinds of fields |
| Workflow event types, Triggers and workflows for developers | steps around publishing |
| Cronjob parts, CLI scripts and console commands | work outside a request |
| Facts, themes and logos for the system card | add your extension to exp:expfetch, exp:info and exp:about |
Front end
| Chapter | |
|---|---|
| A design inside an extension, CSS and JavaScript in an extension | templates and assets |
| Ajax with ezjscore server functions | dynamic parts |
| Translations in an extension | every text in every language |
Data and the system
| Chapter | |
|---|---|
| Persistent objects and your own tables, Database schema, .dba files and upgrades | storage |
| Events, listeners and filters, Handlers named by settings, Kernel class overrides: the last resort | changing system behavior |
Quality
| Chapter | |
|---|---|
| Security in extensions, Content Security Policy for extension authors | safe by default |
| Admin pages in the admin4 style | consistent administration pages |
| Tests for extensions, Debugging extensions, Performance in extensions | working, and fast |
| Documenting your extension | including help pages in this help center |
Tutorials
Tutorials: build real extensions step by step: the RAD tools tour, then each kind of extension built with the RAD wizard and again by hand, ending with a capstone extension from idea to release.
Before you start
You should have read Part 1 and know the builder's tools of Part 2. You need a development installation with debug output on and basic PHP.
Related pages
- Previous: When settings are not enough
- Next: The extension directory layout
- Extensions: find, install, configure, build and release
- Extension points
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.