2 ms·
Route functions aren't like controllers. Controller is an abstraction that has nothing to do with http. It doesn't correspond to http. When MVC was shoehorned
by MatthewPhillips 14y ago
Route functions aren't like controllers. Controller is an abstraction that has nothing to do with http. It doesn't correspond to http.
When MVC was shoehorned into http the controller was meant to control the resource, which is how people know of it. But it also controls the collection of resources.
The route function is much simpler than a controller, it only handles one particular method of a resource.
- notJim 14y agoI don't really understand your point. In MVC, we use functions on the controller to handle the incoming request and the response. There is usually a router that routes an incoming request to the corresponding controller and function. How is this different than what a route function does?
- MatthewPhillips 14y agoBecause a route function is a function and a controller is a collection of functions (that is its own abstraction not directly related to http).