"Fossies" - the Fresh Open Source Software Archive

Member "drupal-9.1.0-rc1/core/lib/Drupal/Core/Menu/LocalTaskInterface.php" (18 Nov 2020, 2190 Bytes) of package /linux/www/drupal-9.1.0-rc1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "LocalTaskInterface.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 namespace Drupal\Core\Menu;
    4 
    5 use Drupal\Core\Routing\RouteMatchInterface;
    6 
    7 /**
    8  * Defines an interface for menu local tasks.
    9  *
   10  * Menu local tasks are typically rendered as navigation tabs above the content
   11  * region, though other presentations are possible. It is convention that the
   12  * titles of these tasks should be short verbs if possible.
   13  *
   14  * @see \Drupal\Core\Menu\LocalTaskManagerInterface
   15  */
   16 interface LocalTaskInterface {
   17 
   18   /**
   19    * Get the route name from the settings.
   20    *
   21    * @return string
   22    *   The name of the route this local task links to.
   23    */
   24   public function getRouteName();
   25 
   26   /**
   27    * Returns the localized title to be shown for this tab.
   28    *
   29    * Subclasses may add optional arguments like NodeInterface $node = NULL that
   30    * will be supplied by the ControllerResolver.
   31    *
   32    * @return string
   33    *   The title of the local task.
   34    */
   35   public function getTitle();
   36 
   37   /**
   38    * Returns the route parameters needed to render a link for the local task.
   39    *
   40    * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
   41    *   The current route match.
   42    *
   43    * @return array
   44    *   An array of parameter names and values.
   45    */
   46   public function getRouteParameters(RouteMatchInterface $route_match);
   47 
   48   /**
   49    * Returns the weight of the local task.
   50    *
   51    * @return int|null
   52    *   The weight of the task or NULL.
   53    */
   54   public function getWeight();
   55 
   56   /**
   57    * Returns options for rendering a link to the local task.
   58    *
   59    * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
   60    *   The current route match.
   61    *
   62    * @return array
   63    *   An associative array of options.
   64    */
   65   public function getOptions(RouteMatchInterface $route_match);
   66 
   67   /**
   68    * Sets the active status.
   69    *
   70    * @param bool $active
   71    *   Sets whether this tab is active (e.g. a parent of the current tab).
   72    *
   73    * @return $this
   74    *   The called object for chaining.
   75    */
   76   public function setActive($active = TRUE);
   77 
   78   /**
   79    * Gets the active status.
   80    *
   81    * @return bool
   82    *   TRUE if the local task is active, FALSE otherwise.
   83    *
   84    * @see \Drupal\system\Plugin\MenuLocalTaskInterface::setActive()
   85    */
   86   public function getActive();
   87 
   88 }