menu_secondary_local_tasks

function menu_secondary_local_tasks

menu_secondary_local_tasks()

Returns the rendered local tasks at the second level.

Deprecated

in Drupal 8.0.0, will be removed before Drupal 9.0.0.

Related topics

Menu system
Define the navigation menus, local actions and tasks, and contextual links.

File

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

Code

function menu_secondary_local_tasks() {
  /** @var \Drupal\Core\Menu\LocalTaskManagerInterface $manager */
  $manager = \Drupal::service('plugin.manager.menu.local_task');
  $links = $manager->getLocalTasks(\Drupal::routeMatch()->getRouteName(), 1);
  // Do not display single tabs.
  return count(Element::getVisibleChildren($links['tabs'])) > 1 ? $links['tabs'] : '';
}

© 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/core!includes!menu.inc/function/menu_secondary_local_tasks/8.1.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部