Skip to content

Instantly share code, notes, and snippets.

View dragoonis's full-sized avatar

Paul Dragoonis dragoonis

View GitHub Profile
Where's the modules dir? [/var/www/ppi-skeleton/modules]:
Created module: FoursquareModule
To activate it, add 'FoursquareModule' to your 'activeModules' setting in ./app/modules.config.php
@dragoonis
dragoonis / index.js
Last active December 11, 2015 06:28
var map = null,
latitude = null,
longitude = null,
infoWindow = null;
function useDefaultLocation() {
latitude = 31.8391;
longitude = -106.5631;
}
<?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');
/**
* @param string $name The Service Name
* @param bool $usePeeringServiceManagers
* @return array|object
* @throws \Exception
*/
public function get($name, $usePeeringServiceManagers = true)
{
try {
return parent::get($name, $usePeeringServiceManagers);
<?php
/**
* @param string $name The Service Name
* @param bool $usePeeringServiceManagers
* @return array|object
* @throws \Exception
*/
public function get($name, $usePeeringServiceManagers = true)
{
<?php
public function get($name)
{
try {
$result = parent::get($name);
return $result;
} catch(\Exception $e) {
do {
var_dump($e->getMessage());
cd /var/www/ppi-skeleton
./app/console module:create FoursquareModule
#map {border:1px solid #565656;width:100%;height:500px;}
#map img { max-width: none !important; }
<?php
public function getServiceConfig()
{
return array('factories' => array(
// Create a service named foursquare.handler and map it to this lazy-loaded closure
// this is called from the controller. The code in this function is not called until a
// getService() call from a controller happens or if another service invokes it.
'foursquare.handler' => function($sm) {
Foursquare_Venues:
pattern: /foursquare/getVenues/lat/{lat}/lng/{lng}
defaults: { _controller: "FoursquareModule:Index:getVenues" }