我试图创建一个 drupal 模块,但是当我进入页面 /polcode 时,我收到了这个通知:
拒绝访问 您无权访问此页面。
这是我的模块:
<?php
// $Id$
/**
* @file
* A module exemplifying Drupal coding practices and APIs.
*
* This module provides a block that lists all of the
* installed modules. It illustrates coding standards,
* practices, and API use for Drupal 7.
*/
/**
* Implements hook_menu().
*/
function polcode_menu()
{
$items['polcode'] = array
(
'title' => 'tytuł',
'description' => 'opis',
'page callback' => 'drupal_get_form',
'page arguments' => array('input_simple_form'),
'access calback' => TRUE,
);
return $items;
}
/*
* Form
*/
function input_simple_form($form, &$form_submit)
{
$form['color'] = array
(
'#title' => t('Color'),
'#type' => 'textfield',
'#required' => TRUE,
'#description' => t('Opis'),
);
$form['submit'] = array
(
'#type' => 'submit',
'#value' => 'submit',
);
return $form;
}
我已经清除了缓存,并在后端启用了模块,而且我以管理员身份登录,怎么了?这是信息:
;$Id$
name = polcode
description = A first module.
package = Drupal 7 Development
core = 7.x
files[] = polcode.module
;dependencies[] = autoload
;php = 5.2