Skip to content

Instantly share code, notes, and snippets.

@edutrul
Created September 25, 2015 04:57
Show Gist options
  • Save edutrul/79144507ec9a733a201e to your computer and use it in GitHub Desktop.
Save edutrul/79144507ec9a733a201e to your computer and use it in GitHub Desktop.
<?php
function mymodule_menu() {
$items['fancystuff/json/%'] = array(
'access callback' => true, // available to all
'page callback' => 'mymodule_fancystuff_object', // defined below
'page arguments' => array(2),
'delivery callback' => 'drupal_json_output'
);
return $items;
}
function mymodule_fancystuff_object($userid) {
return array('test'=>true,'dummy'=>array(0, 1, $userid));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment