CodeIgniter - basic question


/ Published in: PHP
Save to your folder(s)

I am having a bit of trouble figuring out what goes where in my application. I guess this is something of a fundamental lack of understanding I have, and I'm hoping somebody might be able to clear things up. This is all very much pseudo code.

In this example let's assume that I'm writing a program that keeps track of students grades, classroom attendance, etc. A school has a collection of classrooms, and a classroom has a collection of students. I'm going to create a basic controller, model, as well as another class I'll call Student.

Please note that the point of this is that I'm not sure if the Student class should be there, or if the Student model should be all I use, or if the Student class should have it's own ability to access the DB. In this simple example I'm simply looking at the student, but the same questions could apply to the Classroom, the School, etc. AGAIN, THIS IS PSEUDO CODE SO THERE ARE A FEW PLACES THAT I AM WRITING GARBAGE CODE TO ASK A QUESTION!

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.