I have enabled a form under modules but accessing the page gives "page not found" error.
sites/default/modules/awesome_form/awesome_form.module
function awesome_form_menu(){
$items['my-new-form'] = array(
'title' => 'simple form',
'type' => MENU_NORMAL_ITEM,
'page callback' => 'drupal_get_form',
'page arguments' => array('show_form_callback'),
'access arguments' => array('access content'),
'file' => 'application_file.inc'
);
return $items;
}
sites/default/modules/awesome_form/application_file.inc
function show_form_callback($form, &$form_state){
$form['test_input'] = array(
'#type' => 'textfield',
'#required' => TRUE,
'#title' => 'Name'
);
return $form;
}
sites/default/modules/awesome_form/awesome_form.info
name = Awesome Form
description = Some Test Form
core = 7.x
and when I browse to mysite.com/my-new-form
I get "page not found" error. I also have enabled the module "Awesome Form" under modules. Yet same issue.
sites/default/modules
? Shouldn't it be insites/all/modules
instead? – Romain Valeri