drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.04k stars 1.06k forks source link

Link Generator #2070

Open oferns opened 2 weeks ago

oferns commented 2 weeks ago

As per the gitter chat, is there scope for providing a LinkGenerator similar to ASP.NETs LinkGenerator class? It would be very useful in CSP views and controllers that want to redirect to somewhere else in the app. The idea being you pass a controller name and some route values and it would return a relative or absolute Uri (depending on what was requested). It should make code that uses it resilient to any routing changes in the app. For example, if I change the route on a controller, then code using the LinkGenerator will not need to be changed to get the new route