Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.63 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. MVC and Mysql conceptual dilemma - Want to retrieve mysql data from the VIEW for a list of items that is returned from the CONTROLLER
  2. $data['recentEntries'] = $this->Entries->getRecentEntries($id);
  3.        
  4. $data['recentEntries'] = $this->Entries->getRecentEntries($id);
  5.  
  6. $data['votes'] = array();
  7.  
  8. foreach ($data['recentEntries'] as $entry) {
  9.     array_push($data['votes'], $this->Votes->getVotes($entry->id));
  10. }
  11.        
  12. if (count($recentEntries)>0) {
  13.     foreach ($recentEntries as $row)
  14.     {
  15.         echo $row->content;
  16.     }
  17. }
  18.        
  19. foreach ($data['recentEntries'] as $entry) {
  20.      $data['votes'][$entry->id] = $this->Votes->getVotes($entry->id);
  21. }