2013-03-28 29 views
1

我想創建一個Drupal模塊,但是當我去頁/ polcode我得到這樣的通知:Drupal的訪問被拒絕在hook_menu實施

拒絕訪問 您無權訪問此頁面。

這是我的模塊:

<?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; 
} 

我已清除緩存,並在後臺觸發模塊,還我loged作爲管理員,有什麼不對? 這是信息:

;$Id$ 

name = polcode 
description = A first module. 
package = Drupal 7 Development 
core = 7.x 
files[] = polcode.module 

;dependencies[] = autoload 
;php = 5.2 

回答

2

你拼錯access callback,它改變:

'access calback' => TRUE, 

是:

'access callback' => TRUE,