menu_set_active_item

function menu_set_active_item

menu_set_active_item($path)

Sets the active path, which determines which page is loaded.

Note that this may not have the desired effect unless invoked very early in the page load, such as during hook_boot(), or unless you call menu_execute_active_handler() to generate your page output.

Parameters

$path: A Drupal path - not a path alias.

Related topics

File

includes/menu.inc, line 2350
API for the Drupal menu system.

Code

function menu_set_active_item($path) {
  $_GET['q'] = $path;
  // Since the active item has changed, the active menu trail may also be out
  // of date.
  drupal_static_reset('menu_set_active_trail');
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!menu.inc/function/menu_set_active_item/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部