Last active
December 10, 2015 20:58
-
-
Save dragoonis/4491602 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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