Create a thumbnail for each event in index view

This commit is contained in:
Kyle Johnson 2014-12-23 22:11:24 -05:00
parent 1146e42c0f
commit 930b94be40
1 changed files with 8 additions and 0 deletions

View File

@ -18,10 +18,18 @@ class EventsController extends AppController {
* index method * index method
* *
* @return void * @return void
* This also creates a thumbnail for each event.
*/ */
public function index() { public function index() {
$this->Event->recursive = -1; $this->Event->recursive = -1;
$events = $this->Event->find('all'); $events = $this->Event->find('all');
foreach ($events as $key => $value) {
$thumbData = $this->createThumbnail($value['Event']['Id']);
$events[$key]['thumbData'] = $thumbData;
}
$this->set(array( $this->set(array(
'events' => $events, 'events' => $events,
'_serialize' => array('events') '_serialize' => array('events')