Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foo_menu(){
- $items=array();
- $items['foo'] = array(
- 'page callback' => 'foo_list',
- ...
- 'type' => MENU_LOCAL_TASK,
- );
- $items['foo/list'] = array(
- 'type' => MENU_DEFAULT_LOCAL_TASK,
- );
- $items['foo/add'] = array(
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('foo_add_form'),
- ...
- 'type' => MENU_LOCAL_TASK,
- );
- $items['foo/%bar/edit'] = array(
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('foo_edit_form',1, 2)
- ...
- 'type' => MENU_LOCAL_TASK,
- );
- $items['foo/%bar/clone'] = array(
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('foo_edit_form',1, 2)
- ...
- 'type' => MENU_LOCAL_TASK,
- );
- $items['foo/%bar/delete'] = array(
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('foo_edit_form',1, 2)
- ...
- 'type' => MENU_LOCAL_TASK,
- );
- return $items;
- }
- foo_list($form, &$form_state) {...}
- foo_add_form($form, &$form_state) {...}
- foo_edit_form($form, &$form_state, $bar, $action){...}
- bar_load($barname) {
- dpm($barname, 'this called several times and should return a bar-object');
- ...
- return $barobject;
- }
- Problem: bar_load() is called several times even when requesting foo, foo/list or foo/add as long as menu items including %bar exist.
Advertisement
Add Comment
Please, Sign In to add comment