[eluser]Unknown[/eluser]
I have decided that it is time to learn a framework and decided that CI will be the one I use. I am familiar with the principles of MVC, but have never coded a project with it.
My question is about the html table helper and where the various methods should be executed. I would like to follow MVC conventions as strictly as possible as a learning exercise. Here are the ways I have thought of doing it.
1. Retrieve the data with my model, have the model modify and generate the table, and return the table to the controller. The controller would set the table into a variable to be injected into a view.
2. Retrieve the data with my model and return the query result object or array to the controller. Table would be built and generated by the controller and set to a variable for injection into a view.
3. Retrieve data with model, return result object or array to controller, build the table in the controller and set to variable for injection in view. Execute the actual $this->table->generate() statement in the view.
4. Retrieve the data with model, return array to controller, manipulate data in the controller, inject array into view. The view would loop through the array and manually build the table.
I'm leaning toward option 4 because it allows for the view to control the styling and structure of the table. Is this the best MVC way of doing this?