Tutorials: build real extensions step by step
These tutorials belong to Part 3 of the book. Each one builds a small, working extension and shows every
file in full, the commands to switch it on, and what you should see. The PHP files were checked with php -l and, where
it is safe, run with the kernel loaded; the template samples were rendered by the template engine.
Two ways to the same result
| With the RAD tools | By hand | |
|---|---|---|
| Where | Setup > RAD (/setup/rad) in the administration | your editor and a terminal |
| Speed | a working skeleton in minutes | minutes for small things, longer for big ones |
| What you learn | which files and settings a mechanism needs | why each line is there |
| Best for | starting something new; checking you did not forget a setting | small changes; understanding; working without the admin |
Do one of each for the same mechanism and compare the files: that is the fastest way to learn the anatomy.
With RAD
| Tutorial | Builds |
|---|---|
| The RAD tools tour | the catalogue, the survey, the health check, and how every wizard works |
| A template operator in five minutes | operators, functions, fetch functions and fetch aliases |
| A datatype | a new kind of field with its templates |
| A module with views | a module with views and policies, or a module over existing tables |
| A workflow event | a workflow event type with its templates |
| A design extension | a theme skeleton with pagelayout, override and stylesheets |
| A settings-only extension | settings, listeners and siteaccess customizations |
| Handlers and kernel overrides | a handler named by a setting, and the last resort |
By hand
| Tutorial | Builds |
|---|---|
| The smallest extension in five minutes | metadata and settings, nothing else |
| A template operator | mysite_greet and mysite_initials |
| A fetch function | fetch( 'hello', 'newest', ... ) |
| A module with a view | /hello/world/<name> |
| A module protected by a policy | an admin page only some roles may open |
| A datatype | a rating from 1 to 5 |
| A workflow event | a log line for every publication |
| A cronjob part | a nightly digest |
| Your own table with eZPersistentObject | a greetings table with its class |
| An ezjscore server function | an ajax call answered in JSON |
| A rich text custom tag | a tag editors can use in rich text |
| Translating an extension | German texts for everything above |
| Help pages for your extension | pages and context help in the help center |
| A PHPUnit test | tests that run without a database |
Capstone
A complete extension from idea to release puts the pieces together and publishes the result, following Part 7.
What you need
A development installation with debug output on (Setting up a development installation),
and for the RAD tutorials an administrator with the setup/setup policy. All tutorials use the extension name
mysite_hello; pick your own prefix for real work.
Related pages
- Previous: Documenting your extension, including help pages
- Next: The RAD tools tour: Setup > RAD
- RAD tools
- 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.