[eluser]Dready[/eluser]
The scenario is : I'm currently implementing CRUD (+display) in my ORM class. To enable this : I have the "base" class dealing only with database stuff (fectching, updating,...) and I'm coding a subclass of this base class for CRUD stuff. Perhaps because I'm a lazy guy, and perhaps because it's simplest, I'm confronted to this dilemna : if I respect the MVC rules, I have to duplicate the processing : once for my model to output itself as an array, and once for the controller or view, that parses the array and sends back HTML.
Because it's duplicate processing, and because it duplicates code too, I came to a solution I find elegant, that is a function that, without argument, returns the array, and with an argument (more or less a hash of templates) directly returns HTML.
But MVC design doesn't strictly allow this, and I'm wondering if it's only bad in theory (in this case I don't care), or if that could lead me to problems when developing my "business" classes, that will extend the "orm crud" class.