
Untitled
By: a guest on
Jun 26th, 2012 | syntax:
None | size: 0.63 KB | hits: 8 | expires: Never
MVC and Mysql conceptual dilemma - Want to retrieve mysql data from the VIEW for a list of items that is returned from the CONTROLLER
$data['recentEntries'] = $this->Entries->getRecentEntries($id);
$data['recentEntries'] = $this->Entries->getRecentEntries($id);
$data['votes'] = array();
foreach ($data['recentEntries'] as $entry) {
array_push($data['votes'], $this->Votes->getVotes($entry->id));
}
if (count($recentEntries)>0) {
foreach ($recentEntries as $row)
{
echo $row->content;
}
}
foreach ($data['recentEntries'] as $entry) {
$data['votes'][$entry->id] = $this->Votes->getVotes($entry->id);
}