How to alter the Route based on its parameters
The client recently asked me:
“I want to change how the Taxonomy Vocabulary page works. It should have a custom filter and more columns, but you should keep the default functionality like sorting, hierarchy, etc. Also, I want this change to apply only to a few vocabularies, not all of them.”
Most of us are familiar with Route Subscribers, which can be used to alter route defaults. However, they’re executed before the actual request, so we don’t have access to the real values of the route parameters — meaning we can’t make decisions based on them.
That’s where the Route Enhancer comes into play.
