Skip to content
For AI agents: the complete documentation index is available at llms.txt; this page is also available as Markdown at index.md.

Dynamic configuration

ConfigResolver

Dynamic configuration is handled by the ConfigResolverInterface.

It exposes the hasParameter() and getParameter() methods. You can use them to check the different scopes available for a given namespace to find the appropriate parameter.

To work with the ConfigResolver, your dynamic settings must have the following name format: <namespace>.<scope>.parameter.name.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
parameters:
    # Internal configuration
    ibexa.site_access.config.default.content.default_ttl: 60
    ibexa.site_access.config.site_group.content.default_ttl: 3600

    # Here "myapp" is the namespace, followed by the SiteAccess name as the parameter scope
    # Parameter "my_param" will have a different value in site_group and admin_group
    myapp.site_group.my_param: value
    myapp.admin_group.my_param: another value
    # Defining a default value, for other SiteAccesses
    myapp.default.my_param: Default value

Inside a controller extending the Ibexa\Core\MVC\Symfony\Controller\Controller class, in site_group SiteAccess, you can use the parameters in the following way (the same applies for hasParameter()):

Tip

To learn more about scopes, see SiteAccess documentation.

Both getParameter() and hasParameter() can take three arguments:

  1. $paramName - the name of the parameter
  2. $namespace - your application namespace, myapp in the previous example. If null, the default namespace is used, which is ibexa.site_access.config by default.
  3. $scope - a SiteAccess name. If null, the current SiteAccess is used.