Drupal表单找不到页面

问题描述 投票:0回答:1

我在模块下启用了一个表单,但是访问该页面会出现“找不到页面”错误。

网站/默认/模块/ 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;
}

网站/默认/模块/ awesome_form / application_file.inc

function show_form_callback($form, &$form_state){
  $form['test_input'] = array(
    '#type' => 'textfield',
    '#required' => TRUE,
    '#title' => 'Name'
  );
  return $form;
}

网站/默认/模块/ awesome_form / awesome_form.info

name = Awesome Form
description = Some Test Form
core = 7.x

当我浏览到mysite.com/my-new-form时,我收到“找不到页面”错误。我还在模块下启用了“Awesome Form”模块。然而同样的问题。

drupal drupal-7 drupal-modules
1个回答
0
投票

您的模块只是在干净安装上进行测试。我唯一没做的就是打开模块文件和.inc文件中的php标签,就是这样。一切都按预期工作。

© www.soinside.com 2019 - 2024. All rights reserved.