I’ve been writing function oriented PHP for over a decade… it’s always done what I want it to do (more or less)… but I decided, this time I’m going to go for OOP and a framework. Yii looks better than all the others and so far, it has been awesome. I’ve created a data structure to hold data for an annual report which multiple chapters of an organization have to fill out every year.
I’ve structured the data like this:
Using Gii, I’ve got nice really nice crud pages which I then modified to pick up fields from other tables, etc. But now I’m not sure what to do regarding combining this all into a usable form for a user. Here’s what I envision:
When a user logs in, they will be directed to their chapter’s “dashboard.” That dashboard will contain a list of categories which will each have a “completion percentage” as a percentage of completed subtasks for that chapter in that category… I can write that SQL… but I’m not sure if I create a new view within category? a site page? a whole new mvc for something called dashboard?
When a user clicks on a category, it opens a list of the tasks for that category, each task expandable with subtasks (subtask table) below each task (task table) (hell, doesn’t even have to be expandable) and a checkbox (subtask_status.complete BOOLEAN) next to each subtask. Once again, where do I put something like this? Do I leverage the models for each of these tables to create some sort of single model or do I leverage the models only within a view of some sort?
I’ve gotten a pretty good feel for altering the crud files created by gii, and for making individual pages and using extensions… just trying to feel my way along to the next step.