[ create a new paste ] login | about

Link: http://codepad.org/UBwUPxnU    [ raw code | fork ]

PHP, pasted on Jun 5:
<?php
/**
 * Implements hook_menu()
 */
function test_menu() {
  $items['testpage'] = array(
    'title' => 'Test Path',
    'page callback' => 'test_path_callback',
    'type' => MENU_NORMAL_ITEM,
    'access callback' => true,
  );
  $items['testpage/changeme'] = array(
    'title' => 'Test Path Original',
    'page callback' => 'test_path_change_callback',
    'type' => MENU_NORMAL_ITEM,
    'access callback' => true,
  );

  return $items;
}
/**
 * Implements hook_init()
 */
function test_init() {
  if(arg(0) == 'testpage') {
    $item = menu_get_item('testpage/changeme');
    $item['title'] = 'Test Path Changed';
    $item['path'] = 'testpage/changeme/1';
    menu_set_item('testpage/changeme',$item);
  }
}
/**
 * Callback test
 *
 * @return string html
 * @author Samuel Leathers <sbl5007@psu.edu>
 **/
function test_path_callback()
{
  return '';
}
function test_path_change_callback() {
  return '';
}

?>


Create a new paste based on this one


Comments: