0

I'm a CI newb, And I'm converting a site I've developed procedurally, and I want to be as "correct" as possible... I have my default controller, which has one class, and within it a method per page, each which loads different content views depending on which page is being visited.

Easy enough... But let's say that on the persons page, within the persons table, there are fields containing details about each respective person coming from various tables (ie favorite beers, recent purchases, favorite colors, etc...). So maybe I should have a "person" class and different methods calling different models? I want to play by the rules, but get there as quickly as possible. Many thanks in advance!

matticus_1120
  • 51
  • 1
  • 1
  • 5
  • I'm not able to get a clear overview of what you have and what you want. It sounds like this would be solved with a model? – Robin Castlin Jun 08 '12 at 12:36
  • I guess the approach is correct. Not necessarily the controller "beer" will call the model "beer_model". You can create a method beer_consumption($person_id) within the controller "Person" and call the "Beer" model – csotelo Jun 08 '12 at 13:03

1 Answers1

0

Yes you should have this "Person" class this is your model. Implement all the functionality there and use it in your controller

greenLizard
  • 2,326
  • 5
  • 24
  • 30