prestaconcept / PrestaSitemapBundle

A symfony bundle that provides tools to build a rich application sitemap. The main goals are : simple, no databases, various namespace (eg. google image), respect constraints etc.
MIT License
347 stars 100 forks source link

Make url generator available on `SitemapPopulateEvent` #286

Closed kbond closed 2 years ago

kbond commented 2 years ago

Description
A very common use case for using this event is to use the url generator to generate URLs. I think it would be a nice quality of life improvement to make the url generator available on the event itself. If of interest, I can make a PR.

Example

$event->getUrlGenerator()->generate(...);
yann-eugone commented 2 years ago

I think most subscribers to this event has a direct dependency to the URL generator.

It could be a good DX idea to provide this service via the event. So yeah, I'd love a PR for that.

While you're working on this, please think about BC. Everything must be optional if we want to include this in a 3.1.0. We will be required to think about triggering deprecation too.