July 2017
Intermediate to advanced
456 pages
11h 32m
English
Functions on the services that are called after it is instantiated. These can be used to set additional options on the service, especially ones that might not be required. For instance, on the url_generator service it has specific dependencies on the non-bubbling URL Generator Service as well as a Renderer service.
url_generator: class: Drupal\Core\Render\MetadataBubblingUrlGenerator arguments: ['@url_generator.non_bubbling', '@renderer'] calls: - [setContext, ['@?router.request_context']]
If you look at the UrlGenerator class--the one that's created for the url_generator.non_bubbling service--you'll see that it creates its own RequestContext. However, if there is a current RequestContext for the Router, we'd want to use that instead ...
Read now
Unlock full access