Skip to content

Instantly share code, notes, and snippets.

@dragoonis
Last active December 10, 2015 20:58
Show Gist options
  • Save dragoonis/4491602 to your computer and use it in GitHub Desktop.
Save dragoonis/4491602 to your computer and use it in GitHub Desktop.
<?php
namespace FoursquareModule\Controller;
use FoursquareModule\Controller\Shared as SharedController;
class Index extends SharedController
{
public function indexAction()
{
return $this->render('FoursquareModule:index:index.html.php');
}
// Get the lat/long from the route, get venues from the foursquare.handler, and output them as json
public function getVenuesAction()
{
$lat = $this->getRouteParam('lat');
$lng = $this->getRouteParam('lng');
$handler = $this->getService('foursquare.handler');
$venues = $handler->getVenues($lat, $lng);
return json_encode($venues, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment