3 ms·
In an MVC, the views are used both for output of the model and to map input back to the controllers. Without the input, its not part of the MVC pattern.
by Androsynth 14y ago
In an MVC, the views are used both for output of the model and to map input back to the controllers. Without the input, its not part of the MVC pattern.
- TylerE 14y agoBullshit. Please show me your Rails-or-similar app that's doing INPUT parsing in the view (embedded JS doesn't count)
- Androsynth 14y agoWhen you click a link on a web page, it gets routed to a controller action. Thats done because the link was generated with the url: example.com/controller/action. Its not about parsing input, its about routing.
- melvinmt 14y agoIt's the browser who renders anchor tags clickable - if you click on a link in a RSS reader you also get routed.
- randomdata 14y agoHATOES says that your XML/JSON/whatever needs to have those same links. What is the difference between an <a href=""> link in HTML and a { action_url: "" } property in JSON?
- Androsynth 14y agoNothing I suppose. I don't think that html vs json was what MVC's[1] creators had in mind for it, but if the json is rendered in such a way that it has links pointing back to the controller, it is a view. [1] Although were talking about Model 2 here, so thats irrelevant. Come to think of it, this whole discussion is pointless: we're arguing about whether views in a Model 2 architecture are proper MVC views...
- dkharrat 14y agoI disagree. Yes, MVC provides a pattern that allows views to be input to the user, but if it doesn't make sense for your app, it's perfectly fine to make the view "read-only" and still abide by the spirit of MVC. If you're claiming that regular HTML views are compliant with MVC because they have HTML links, one can argue that some RSS readers convert the reference links from the RSS feed to actual HTML links that you can use to navigate to the individual RSS item. How is that different than a regular HTML view with links?