OsakaWebbie
Programmer
I'm starting to rewrite some code of a big database interface in OOP (my first venture into that world), and I want to do the MVC separation thing if I can get my brain around it. Envisioning models is pretty easy, but I'm not sure about views. When I think about what things in my application would be good in a class, one that comes to mind that I currently do over and over is a particular type of table layout (kinda fancy, with a fair amount of jQuery and configurable columns) - I use the same kind of table with a variety of data, so I was thinking that a class for the table might be good, so that the code to generate it is consolidated in one place. Perhaps I'd have a property for an array of the column names and CSS classes, another property of an array of the data (or perhaps I'd have the controller just pass the instantiated model of the data to it), and methods like render(). But when I look at tutorials that give examples of views, they don't have class definitions at all - they are like templates, with just HTML and hooks for variable data to be inserted.
So if my thinking is sound to imagine a class for building an HTML structure like my fancy table, where would such a class be stored in an MVC architecture?
So if my thinking is sound to imagine a class for building an HTML structure like my fancy table, where would such a class be stored in an MVC architecture?