简体   繁体   中英

Drupal Access denied in hook_menu implementation

I trying to create a drupal module, but when I go on page /polcode I get this notice:

Access denied You are not authorized to access this page.

This is my module:

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

I had cleared cache, and enable module in backend, also I'm loged in as admin, what's wrong? And this is info:

;$Id$

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

;dependencies[] = autoload
;php = 5.2 

You misspelled access callback , change it from:

'access calback' => TRUE,

to be:

'access callback' => TRUE,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM