Skip to content

Instantly share code, notes, and snippets.

@hotwebmatter
Forked from cafuego/module.php
Last active December 16, 2015 02:49
Show Gist options
  • Save hotwebmatter/5365656 to your computer and use it in GitHub Desktop.
Save hotwebmatter/5365656 to your computer and use it in GitHub Desktop.
<?php
function static_json_menu() {
// $items['view/path/that/returns/the/json'] = array(
$items['store-locator/json'] = array(
'title' => t('JSON Callback'),
'page callback' => 'mymod_callback',
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
return $items;
}
function static_json_callback() {
// $json = "/some/file/on/disk.js";
$json = "sites/default/files/google_store_locator/json";
die(file_get_contents($json));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment