annotate core/lib/Drupal/Core/Menu/LocalActionManagerInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Core\Menu;
Chris@0 4
Chris@0 5 use Drupal\Component\Plugin\PluginManagerInterface;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Manages discovery and instantiation of menu local action plugins.
Chris@0 9 *
Chris@0 10 * Menu local actions are links that lead to actions like "add new". The plugin
Chris@0 11 * format allows them (if needed) to dynamically generate a title or the path
Chris@0 12 * they link to. The annotation on the plugin provides the default title,
Chris@0 13 * and the list of routes where the action should be rendered.
Chris@0 14 */
Chris@0 15 interface LocalActionManagerInterface extends PluginManagerInterface {
Chris@0 16
Chris@0 17 /**
Chris@0 18 * Gets the title for a local action.
Chris@0 19 *
Chris@0 20 * @param \Drupal\Core\Menu\LocalActionInterface $local_action
Chris@0 21 * An object to get the title from.
Chris@0 22 *
Chris@0 23 * @return string
Chris@0 24 * The title (already localized).
Chris@0 25 *
Chris@0 26 * @throws \BadMethodCallException
Chris@0 27 * If the plugin does not implement the getTitle() method.
Chris@0 28 */
Chris@0 29 public function getTitle(LocalActionInterface $local_action);
Chris@0 30
Chris@0 31 /**
Chris@0 32 * Finds all local actions that appear on a named route.
Chris@0 33 *
Chris@0 34 * @param string $route_appears
Chris@0 35 * The route name for which to find local actions.
Chris@0 36 *
Chris@0 37 * @return array
Chris@0 38 * An array of link render arrays.
Chris@0 39 */
Chris@0 40 public function getActionsForRoute($route_appears);
Chris@0 41
Chris@0 42 }