Skip to content

Instantly share code, notes, and snippets.

@iGusev
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save iGusev/8732a8ea566eb1af38ac to your computer and use it in GitHub Desktop.

Select an option

Save iGusev/8732a8ea566eb1af38ac to your computer and use it in GitHub Desktop.
<?php
function mymodule_menu() {
$items = array();
$items['api/%node'] = array(
'page callback' => 'mymodule_api_get_node',
'page arguments' => array(1),
'access callback' => TRUE, // тут аутефикацию можно прикрутить, openid или еще что-нибудь
'type' => MENU_CALLBACK
);
return $items;
}
function mymodule_api_get_node($node) {
drupal_json_output($node);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment