Dealing with bundles¶
eZ Platform is based on the Symfony2 framework and applies a similar way of organizing the app. Like in Symfony, where "everything is a bundle", your eZ Platform application is going to be a collection of bundles.
What is a bundle?¶
A bundle in Symfony (and eZ Platform) is a separate part of your application that implements a feature. You can create bundles yourself or make use of available open-source bundles. You can also reuse the bundles you create in other projects or share them with the community.
Many eZ Platform functionalities are provided through separate bundles included in the installation. You can see the bundles that are automatically installed with eZ Platform in composer.json.
How to use bundles?¶
All the bundles containing built-in eZ Platform functionalities are installed automatically. By default, a clean eZ Platform installation also contains an AppBundle where you can place your custom code.
You can see a list of other available community-developed bundles on https://ezplatform.com/Bundles. Refer to their respective pages for instructions on how to install them.
How to create bundles?¶
You can generate a new bundle using a
generate:bundle command. See Symfony documentation on generating bundles.
How to remove a bundle?¶
To remove a bundle (either one you created yourself, or an out-of-the-box one that you do not need) see the How to Remove a Bundle instruction in Symfony doc.
Structuring a bundle¶
Most projects can use the provided
AppBundle, in the
src folder. It is enabled by default. The project's PHP code (controllers, event listeners, etc.) can be placed there.
Reusable libraries should be packaged so that they can easily be managed using Composer.
Project templates should go into
They can then be referenced in code without any prefix, for example
app/Resources/views/content/full.html.twig can be referenced in Twig templates or PHP as
Project assets should go into the
They can be referenced as relative to the root, for example
web/js/script.js can be referenced as
js/script.js from templates.
All project assets are accessible through the
Configuration may go into
app/config. However, service definitions from
AppBundle should go into
Importing configuration from a bundle¶
The following procedure is valid for any type of settings supported by Symfony framework.
If you are keeping some of your code in a bundle, dealing with core bundle semantic configuration can be tedious
if you maintain it in the main
app/config/ezplatform.yml configuration file.
Importing configuration manually¶
Out of the two ways possible, importing configuration manually is the simplest and has the advantage of being explicit.
It relies on using the
imports statement in your main
1 2 3 4 5 6
templates_rules.yml file should then be placed in the
Resources/config folder in
The configuration tree from this file will be merged with the main one.
1 2 3 4 5 6 7 8 9 10 11 12 13
If both cover the same settings, the imported configuration overrides the main configuration files.
If you want to import configuration for development use only, you can do so in
Importing configuration implicitly¶
The following example shows how to implicitly load settings on the example of eZ Platform kernel. Note that this is also valid for any bundle.
This assumes you are familiar with service container extensions.
Configuration loaded this way will be overridden by the main
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Service container extensions are called only when the container is being compiled, so performance will not be affected.
Versioning a project¶
The recommended method is to version the whole ezplatform repository. Per installation configuration should use
The following tables give an overview of the main eZ Platform bundles.
|ezpublish-kernel||contains the core of the whole eZ Platform application e.g. EzPublishCoreBundle|
|repository-forms||provides form-based interaction for the Repository Value objects|
|ezplatform-solr-search-engine||Solr-powered search handler for eZ Platform|
|ez-support-tools||provides functionality for system information|
|ezplatform-http-cache||HTTP cache handling for eZ Platform, using multi tagging (incl Varnish xkey)|
|ezplatform-design-engine||design fallback system for eZ Platform similar to legacy design fallback system|
|BehatBundle||common reusable sentence implementations and other common needs for Behat testing in eZ bundles/projects|
|date-based-publisher||provides the date based publishing functionality for the eZ Studio product|
|flex-workflow||implementation of a collaboration feature that lets you send content draft to any user for a review or rewriting|
|ezplatform-http-cache-fastly||extends ezplatform-http-cache to support Fastly, for use on Platform.sh PE or standalone|
|ezplatform-multi-file-upload||allows uploading multiple files as new content items at once|
|ezplatform-demo-assets||contains binary install data for ezsystems/ezplatform-demo|
|PlatformUIBundle||provides the main editing and back-end interface for eZ Platform v1|
|PlatformUIAssetsBundle||assets for PlatformUIBundle, branches will only contain meta files and config, tags will contain the assets for eZ Platform v1|
|ezplatform-automated-translation||adds automated translation|
|EzSystemsPrivacyCookieBundle||adds privacy cookie banner|
|ezplatform-richtext||Field Type for supporting rich formatted text stored in a structured XML format|
|CommentsBundle||comment bundle for eZ Platform integrating with Disqus and Facebook and allowing custom integrations|
|EzSystemsRecommendationBundle||integration of YooChoose, a content recommendation solution|
|EzSystemsShareButtonsBundle||adds social share buttons|
|RepositoryProfilerBundle||profiles Platform API/SPI and sets up scenarios to be able to continuously test to keep track of performance regressions of repository and underlying storage engines|
|QueryBuilderBundle||provides a PHP API dedicated to fluently writing repository queries|
|ezstudio-cron||eZ Platform EE 1.x series only - exposes cron/cron package for use in eZ Platform (or just plain Symfony) via a simple command
|cloud-deployment-manager||dedicated cloud deployment manager|
|StudioUIBundle||contains the Studio editing interface in eZ Platform v1|
|ezstudio-form-builder||Form Builder Bundle is a part of eZ Studio and is installed with eZ Studio meta repository in eZ Platform v1|
|EzLandingPageFieldTypeBundle||Landing Page that is at the heart of StudioUI|
|ezstudio-demo-bundle||represents a demo front-end website with eZ Studio|
|ezstudio-personalized-block||Ibexa Personalized Block Bundle|
|CookbookBundle||working examples for using eZ Platform Public API|
|ezplatform-com||the eZ Systems Developer Hub for the Open Source PHP CMS eZ Platform (example site)|
|ezplatform-ee-demo||fork of the "ezplatform-ee" meta repository, contains changes to composer.json, AppKernel.php and config necessary to enable eZ Platform Enterprise Edition Demo. Not recommended for a clean install for new projects, but great for observation and learning (example site)|
|ezplatform-demo||fork of "ezplatform" meta repository, contains code and dependencies for demo distribution of eZ Platform. Not recommended for a clean installation for new projects, but great for observation and learning(example site)|
|TweetFieldTypeBundle||bundle that is created in the Field Type Tutorial (example field type)|
|ezplatform-drawio-fieldtype||provides support for diagrams editing in eZ Platform via draw.io (example field type)|
|ezplatform-ee-beginner-tutorial||resources used in the eZ Platform Enterprise Edition Beginner Tutorial|
|ExtendingPlatformUIConferenceBundle||bundle created in the Extending PlatformUI tutorial|
|docker-php||contains PHP docker image example|
Documentation - additional resources¶
|developer-documentation||source for the developer documentation for eZ Platform, an open source CMS based on the Symfony Full Stack Framework in PHP. https://doc.ezplatform.com|
|user-documentation||source for the user documentation for eZ Platform, an open source CMS based on the Symfony Full Stack Framework in PHP|
|ezpersonalization-documentation||source for the eZ Personalization documentation for eZ Platform, an open source CMS based on the Symfony Full Stack Framework in PHP|
|LegacyBridge||optional bridge between eZ Platform and eZ Publish Legacy that simplifies migration to eZ Platform v1.13 [Community co-maintained]|
|ezplatform-xmltext-fieldtype||XmlText field type for eZ Platform [Community co-maintained]|
|ezflow-migration-toolkit||set of tools that helps migrate data from legacy eZ Flow extension to eZ Studio landing page management|
|ngsymfonytools-bundle||integrates the legacy netgen/ngsymfonytools as a Legacy bundle|
|ezpublish-legacy-installer||A custom Composer installer for eZ Publish legacy extensions|