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 | |
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:
$paramName- the name of the parameter$namespace- your application namespace,myappin the previous example. If null, the default namespace is used, which isibexa.site_access.configby default.$scope- a SiteAccess name. If null, the current SiteAccess is used.