This really has nothing to do with the controller, and everything to do with the routes. To achieve this, you’ll have to add some additional processing at the routing stage.
You can either do it with pattern matching as oli_d111 suggests or you can use a standardised structure.
Both require a fair amount of additional logic, however, for the standardised structure you can do this:
Use a common character as your separator e.g. /
Someone visits
/service/display/45/
Split the route on /
so you get the array $parts = > ['service', 'display', '45']
Use the controller called $parts[0]
call the function called $parts[1]
and then pass in any remaining variables as arguments to the function when it’s called.