For certain entries I would like to be able to override how Craft generates the URLs to them. So I create an Entry Model in my module extending from \craft\elements\Entry and override the getUrl() method there.
However I did not manage to replace Craft's class with mine.
How can I achieve this? I found solutions like
Yii::$container->set('craft\elements\Entry', '\modules\Entry'); or the same with
I placed it in my
index.php, I tried it in the head of
/config/app.php, but nothing happened.