Building extensions for Contao 4
Building extensions for Contao 4 is (currently) still very similar to Contao 3. The fundamentals like DCA, language files and templates are still in place and best practice, but we will slowly migrate to use more and more Symfony components.
In this book, we will cover several chapters on how to prepare your Contao 3 extensions to be compatible with Contao 4, or how to migrate them to a Symfony bundle.
This book is intended as a to guide for developers familiar with Contao 3. If you are new to Contao, you should read the manual or cookbook first (see https://docs.contao.org/).
You can find the latest version of this document on docs.contao.org.
Table of contents
Prerequisites for Contao 3 extensions
- Public folders
Creating a Symfony bundle
- About bundles and extensions
- The folder structure
Using Symfony in Contao 3 code
- Using the DI container
- Generating URLs
- Custom responses
- Adapter classes
The Contao documentation is licensed under a Creative Commons Attribution 3.0 License license (CC BY-NC-SA 3.0). If you want to redistribute a modified or unmodified version of the documentation, you can do so under the license terms.
If you contribute to the documentation, e.g. by creating pull requests, you grant us full usage rights of any content you create or upload. You also ensure that your content does not violate any third-party rights.
We are not claiming exclusive usage rights, therefore you are free to use your contributed content (e.g. texts or images) in any other project as well.