Search code examples
drupaldrupal-7drupal-modules

who create API for drupal site to get content and used in mobile app?


i create function (sbt_conten_post_by_type_json) in > sites > all > modules > content > content-module

and in same file i added (sbt_conten_post_by_type_json) function in menu-hook

$items['sbt_conten_post_by_type_json'] = array(
'page callback' => 'sbt_conten_post_by_type_json',
'access arguments' => array('view_json'),
'type' => MENU_CALLBACK,
);

but when open My_Domin/sbt_conten_post_by_type_json

Nothing happens

why ? Is there anything else should I add ?


Solution

  • When you create your module you have to make new directory in sites/all/modules/my_module

    Inside you place your my_module.module file containing your module code and my_module.info file describing your module. When you do that, on your back-end modules page your module should be visible, but not active. You have to activate it in order to use it.

    https://www.drupal.org/developing/modules/7