나는 드루팔 7을 설치하고 사용자 지정 양식을 만들려고하고 있습니다. 아래 코드는 http://drupal.org/node/717722에서 가져 왔으며 .info 파일을 제외하고는 변경하지 않았습니다. 여기 드루팔 (Drupal 7의 간단한 예제 폼)에 올바르게 구성된 모든 것이 "페이지를 찾을 수 없음"을 보여줍니다. 왜 ..?
내가/모든 사이트에서 그것을는 * my_module * 폴더에이 두 파일을 배치하고 배치 한 my_module.module<?php
/**
* This function defines the URL to the page created etc.
* See http://api.drupal.org/api/function/hook_menu/6
*/
function my_module_menu() {
$items = array();
$items['my_module/form'] = array(
'title' => t('My form'),
'page callback' => 'my_module_form',
'access arguments' => array('access content'),
'description' => t('My form'),
'type' => MENU_CALLBACK,
);
return $items;
}
/**
* This function gets called in the browser address bar for:
* "http://yourhost/my_module/form" or
* "http://yourhost/?q=my_module/form". It will generate
* a page with this form on it.
*/
function my_module_form() {
// This form calls the form builder function via the
// drupal_get_form() function which takes the name of this form builder
// function as an argument. It returns the results to display the form.
return drupal_get_form('my_module_my_form');
}
/**
* This function is called the "form builder". It builds the form.
* Notice, it takes one argument, the $form_state
*/
function my_module_my_form($form_state) {
// This is the first form element. It's a textfield with a label, "Name"
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
);
return $form;
}
?>
my_module.info 아래
name = My module
description = Module for form api tutorial
core = 7.x
입니다/모듈 그 후 , 나는 오류 또는 경고없이 모듈 페이지에서 모듈을 활성화. 내가 URL을 사용하는 localhost/d7/?q=my_module/form
을이 액세스 할 때 이제
, 나는 "페이지를 찾을 수 없습니다"오류가 발생합니다 .. !! 왜..?? 나는 무엇을 놓치고 ..? 이 모듈뿐만 아니라 개발자 모듈 http://drupal.org/project/examples이 예제뿐만 아니라
그것. 같은 오류를 보여줍니다.
당신은'관리/설정/개발/performance'에서 캐시를 지우나요? – nmc
정말 고마워요 !! !! 그게 내가 잘못 가고있는 곳이야. :) – akshaynhegde