Created
April 10, 2013 00:05
-
-
Save cafuego/5350570 to your computer and use it in GitHub Desktop.
Custom module to provide static JSON map data
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 | |
function mymod_menu() { | |
$items['view/path/that/returns/the/json] = array( | |
'title' => t('JSON Callback'), | |
'page callback' => 'mymod_callback', | |
'access callback' => TRUE, | |
'type' => MENU_CALLBACK, | |
); | |
return $items; | |
} | |
function mymod_callback() { | |
$json = "/some/file/on/disk.js"; | |
die(file_get_contents($json)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 3 is missing a closing single quote character.
The gist should read:
Note that this also fixes the syntax highlighting.