Hello

No way to make working the path to the module_drie_form. Any Help ?


/**
* implement hook_menu()
*/

function module_drie_menu(){

  $items= array();
  $items['module/drie'] = array(
  'title'=>'Display text form',
  'description'=>'Link to the  form',
  'page callback'=>'drupal_get_form',
  'page arguments'=>array('module_drie_form'),
  'access arguments' => TRUE,
  'type'=>MENU_NORMAL_ITEM,
 );
  
	return $items;
  
}

/**
* implement drupal_get_form()
*/

function module_drie_form($form, &$form_state){

	$form = array();
	
	$form['texte'] = array(
	  '#type' => 'textfield',
      '#title' => t('Fill your texte there'),
      '#maxlength' => 250,
      '#size' => 100,
      '#required' => TRUE,
	);
	$form['submit'] = array(
	  '#type' => 'submit',
      '#value' => t('sturen'),
	);

	return $form;
}

Thanks

Comments

heine’s picture

'access arguments' => TRUE,

The boolean "everyone has permission" has to be set on access callback, so

'access callback' => TRUE,

Even better; a real permission for access arguments.

Serotonine’s picture

it works !!

But now I've a warning : Invalid argument supplied for foreach() in menu_unserialize() (line 400 of /var/www/drupal-one/includes/menu.inc).

Dunno if it's linked or not...

Thanks anyway !!

Serotonine’s picture

function module_drie_menu(){

  $items= array();
  $items['module_drie_form'] = array(
  'title'=>'Display text form',
  'description'=>'Link to the module drie form',
  'page callback'=>'drupal_get_form',
  'page arguments'=>array(0),
  'access callback' => TRUE,
  'type'=>MENU_NORMAL_ITEM,
 );
  
	return $items;
  
}

/**
* implement drupal_get_form()
*/

function module_drie_form($form, &$form_state){

	$form = array();
	
	$form['texte'] = array(
	  '#type' => 'textfield',
      '#title' => t('Fill your texte there'),
      '#maxlength' => 250,
      '#size' => 100,
      '#required' => TRUE,
	);
	$form['submit'] = array(
	  '#type' => 'submit',
      '#value' => t('sturen'),
	);

	return $form;
  
}