hook-theme

Drupal 7 - get variables from hook_theme

為{幸葍}努か 提交于 2019-12-11 04:52:00
问题 I tried to pass a variable from a custom module to a tpl file. In my custom module (named example) 1. I created a route with an argument via hook_menu : function example_menu() { $items['example/fancybox-photos/%'] = array( 'page callback' => 'example_display_fancybox_photos', 'page arguments' => array(2), 'type' => MENU_CALLBACK, 'access arguments' => array('access content'), ); return $items; } 2. I created my page callback function : function example_display_fancybox_photos($nid) {