Modify static route by event

I try to modify a static route on event. In app/config/services.yml I added:

   AppBundle\EventListener\RoutingListener:
    tags:
        - { name: kernel.event_listener, event: pimcore.frontend.path.staticroute, method: onStaticroute }

Then I created a class src/AppBundle/EventListener/RoutingListener.php with a method “onStaticroute”.

namespace AppBundle\EventListener;
use Pimcore\Event\Model\ElementEventInterface;
class RoutingListener {
	public function onStaticroute(ElementEventInterface $e) {
		$element = $e->getElement();
	dump($element);
	}
}

In the methode I added a breakpoint but nothing happens? I think the event is not fired or not recognized - but why?

My goal is to change language dependent parts of the URL (for example “products” to “produkte”).

Thank you

1 Like

hey, any luck with it?