Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
   eZ Publish 4.x / legacy

eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

The Basics


Configuration is tightly related to the service container.
To fully understand the following, you need to be aware of Symfony's service container and its configuration.

Basic configuration handling in eZ Publish is similar to what is commonly possible with Symfony. In this regard, you can define key/value pairs in your configuration files, under the main parameters key (like in parameters.yml).

Internally and by convention, keys follow a dot syntax where the different segments follow your configuration hierarchy. Usually keys are prefixed by a namespace corresponding to your application.
Values can be anything, including arrays and deep hashes.

eZ Publish core configuration is prefixed by ezsettings namespace while internal configuration (not to be used directly) is prefixed by ezpublish namespace.


Usage from a controller

Dynamic configuration

In eZ Publish, it is fairly common to have different settings depending on the current siteaccess (e.g. languages, content view provider configuration...).


Dynamic configuration can be resolved depending on a scope.

Available scopes are (in order of check) :
1. global
2. SiteAccess
3. default

It gives the opportunity to define settings for a given siteaccess for instance, like in the legacy INI override system.

This mechanism is not limited to eZ Publish internal settings (aka ezsettings namespace) and is applicable for specific needs (bundle related, project related...).

How it works

Dynamic configuration is handled by a config resolver. It consists in an object exposing mainly hasParameter() and getParameter() methods:


Both getParameter() and hasParameter() can take 3 different parameters:

  1. $paramName (i.e. the name of the parameter you need)
  2. $namespace (i.e. your application namespace, myapp in the previous example. If null, the default namespace will be used, which is ezsettings by default)
  3. $scope (i.e. a siteaccess name. If null, the current siteaccess will be used)




  • No labels