The ModularRouting component maps similar requests to different sets of configuration values based on a customizable routing process.
The main driver of this component is the
ModularRouter class, an implementation of Symfony's
ModularRouter class uses a custom matching process to load a different set of routing metadata based on the conditions of a request. To determine which set of metadata matches the request,
ModularRouter relies on an instance of
ProviderInterface to map the request to a
Module and load the metadata associated with it.
This documentation is about the Harmony routing implementation. If you're not familiar with routing in Symfony we recommend reading the relevant Symfony documentation first. If you're interested in using this component with the Symfony framework check out the Symfony Integration section of this page.
Every website has a different content strategy. In some cases the content is pre-determined during development while in other cases content should be easily replaceable using an administration interface. The ModularRouting component offers a mix of both approaches by allowing pre-defined routes to be contained within a module. Every module has a type which is associated with a set of metadata. If a set of metadata was found, the router only uses this metadata to match the request.
Read the Getting started section for more information on how to use the component.
To use the ModularRouting component with your Symfony project, we created an integration bundle. More information can be found in the ModularBundle documentation.