Last active
August 29, 2015 14:06
-
-
Save iGusev/8732a8ea566eb1af38ac to your computer and use it in GitHub Desktop.
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 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