Skip to content

Instantly share code, notes, and snippets.

@LarsEliasNielsen
Created March 5, 2014 13:58
Show Gist options
  • Save LarsEliasNielsen/9367638 to your computer and use it in GitHub Desktop.
Save LarsEliasNielsen/9367638 to your computer and use it in GitHub Desktop.
Drupal 7 Module Development: Menu to config page
<?php
/**
* Implements hook_menu().
*
* Defines paths to provide page callbacks and menu items for the site.
* Here it defines a configuration page with callback to a form, we'll
* create later on.
*
* @url: https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_menu/7
*/
function espn_news_menu() {
$items = array();
// Module configuration page.
$items['admin/config/content/espn_news'] = array(
'title' => 'ESPN News',
'description' => 'Configuration for ESPN News module',
'page callback' => 'drupal_get_form',
'page arguments' => array('espn_news_form'),
'access arguments' => array('administer site configuration'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment