hook_menu实现中的Drupal访问被拒绝

时间:2013-03-28 12:48:35

标签: php drupal drupal-7 drupal-modules

我试图创建一个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 

1 个答案:

答案 0 :(得分:2)

你拼写错误access callback,请改为:

'access calback' => TRUE,

是:

'access callback' => TRUE,
相关问题