Welcome Guest, Not a member yet? Register   Sign In
Newb question: instances of classes vs models?
#3

[eluser]CodeIgniteMe[/eluser]
Just not to confuse any newbies...
[quote author="shoelessone" date="1309387615"]
going to /site/scores calls site_controller->scores()
The Site controller’s function scores() loads the site_model, then does something like $scores = $this->site_model->getScores();
The site controller then passes $scores to the view (say scores_view.php), which loops through the $scores and prints out a list of the sites scores.
[/quote]

must be edited into
Quote:going to /site_controller/scores calls site_controller->scores()
//site_controller URI calls site_controller controller
The Site controller’s function scores() loads the site_model, then does something like $data['scores'] = $this->site_model->getScores();
// store the result in an array if you want to pass it to your view
The site controller then passes $scores to the view (say scores_view.php), which loops through the $scores and prints out a list of the sites scores.


Messages In This Thread
Newb question: instances of classes vs models? - by El Forum - 06-29-2011, 11:46 AM
Newb question: instances of classes vs models? - by El Forum - 07-01-2011, 02:17 AM
Newb question: instances of classes vs models? - by El Forum - 07-10-2011, 07:53 PM
Newb question: instances of classes vs models? - by El Forum - 07-10-2011, 08:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB