
As I was building a module to create bookmark in Drupal, I needed to find the best way to retrieve the page title for any given Url possible (e.g. path aliases).
It turns out there is a resolver service for that: the title_resolver.
However it is not obvious how to use it. There are just a few implementation in core and none is easy to duplicate and use as-is in your own module. So I'd like to share my solution.