Entry 3081

drupal's menu hook problems, with PHP open and closing brackets

   

Submitted by vfclists on Jan. 24, 2010 at 3 a.m.
Language: PHP. Code size: 777 bytes.

<?php

  function menufun_menu() {
  $items['menufun'] = array( 
    'page callback' => 'menufun_hello', 
    'access callback' => TRUE, 
    'type' => MENU_CALLBACK, 
  ); 
  $items['menufun/%menufun'] = array( 
    'page callback' => 'menufun_who',
    'page arguments' => array(1),
    'access callback' => TRUE, 
    'type' => MENU_CALLBACK, 
  );
  $items['menufun/%menufun/wakeup'] = array( 
    'page callback' => 'menufun_oing',
    'page arguments' => array(1),
    'access callback' => TRUE, 
    'type' => MENU_CALLBACK, 
  ); 
  return $items;
}

/**
 * Page callback.
 */
function menufun_hello() {
  return t('Hello!');
}


function menufun_who($x) {
  return $x;
}

function menufun_oing($x) {
    return 'that is ok!';
}
?>

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).