/** * @param null $args */ public function render($args = NULL) { parent::render($args); // TODO: Change the autogenerated stub $articles = $this->articles->where('published < NOW()')->order('created DESC')->limit(10)->fetchPairs('created'); $venues = $this->venues->fetchVisible()->order('created DESC')->limit(10)->fetchPairs('created'); $competitions = $this->competitions->order('created DESC')->limit(10)->fetchPairs('created'); $output = $articles + $venues + $competitions; krsort($output); $this->template->items = $output; $this->template->setFile(__DIR__ . "/StreamControl.basic.latte"); $this->template->render(); }
}); $app->get('/api/venues/', function () { $cn = new Venues(); $cn->getVenues(); }); $app->post('/api/venues/', function () use($app) { $req = $app->request(); $bdy = $req->getBody(); $venue = json_decode($bdy); $cn = new Venues(); $cn->insertVenue($venue[0]); }); $app->get('/api/venues/:id', function ($id) { $cn = new Venues(); $cn->getVenueById($id); }); $app->put('/api/venues/:id', function ($id) use($app) { $req = $app->request(); $bdy = $req->getBody(); $contact = json_decode($bdy); $cn = new Venues(); $cn->updateVenue($id, $location[0]); }); $app->delete('/api/venues/:id', function ($id) { $cn = new Venues(); $cn->deleteVenue($id); }); $app->get('/api/venues/:id/suggestions', function ($id) { $cn = new Suggestions(); $cn->getSuggestionsByVenue($id); });