I'm fairly new to Drupal and just made my first module wich shows a form. In the hook_menu(), I set $items['form'], as you can see below. While I navigate to mysite.com/form, it doesn't show me anything, except for the theme and: Page not found, The requested page "/form" could not be found.
I tried to clear my cache, to give my module a different name, made sure my module is enabled, nothing helps. Does anyone knows what the problem might be? The code from the .module file is right here:
<?php
//implements hook_permission()
function form_example_permission() {
return array(
'Submit form_example' => array(
'title' => t('Submit form_example'),
'description' => t('Submit the form_example form'),
),
);
}
//implements hook_menu()
function form_example_menu() {
$items['form'] = array(
'title' => 'My Example Form',
'type' => MENU_NORMAL_ITEM,
'acces' => TRUE,
'page callback' => 'drupal_get_form()',
'page arguments' => array('form_example_form'),
'acces arguments' => array('acces content'),
);
return $items;
}
//implements hook_form()
function form_example_form($form, &$form_state) {
$form['mynumber'] = array (
'#type' => 'textfield',
'#title' => t('My Number'),
'#size' => 10,
'#maxlength' => 10,
'#required' => TRUE,
'#description' => t('Please enter a valid number'),
);
$form['mytextfield'] = array(
'#type' => 'textfield',
'#title' => t('My Textfield'),
'#size' => 60,
'#maxlength' => 128,
'#required' => TRUE,
);
$form['mytext'] = array(
'#title' => t('My Textarea'),
'#type' => 'textarea',
'#description' => t('Enter some text'),
'#default value' => '',
'#required' => TRUE,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Add item'),
);
return $form;
}