You are here

class DynamicLocalTasks in Advanced Help 8

Defines dynamic local tasks.

Hierarchy

Expanded class hierarchy of DynamicLocalTasks

1 string reference to 'DynamicLocalTasks'
advanced_help.links.task.yml in ./advanced_help.links.task.yml
advanced_help.links.task.yml

File

src/Plugin/Derivative/DynamicLocalTasks.php, line 10

Namespace

Drupal\advanced_help\Plugin\Derivative
View source
class DynamicLocalTasks extends DeriverBase {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    if (\Drupal::moduleHandler()
      ->moduleExists('help')) {
      $this->derivatives['advanced_help.help'] = $base_plugin_definition;
      $this->derivatives['advanced_help.help']['title'] = "Help";
      $this->derivatives['advanced_help.help']['route_name'] = 'help.main';
      $this->derivatives['advanced_help.help']['base_route'] = 'help.main';
      $this->derivatives['help.main'] = $base_plugin_definition;
      $this->derivatives['help.main']['title'] = "Advanced Help";
      $this->derivatives['help.main']['route_name'] = 'advanced_help.main';
      $this->derivatives['help.main']['base_route'] = 'help.main';
      return $this->derivatives;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
DynamicLocalTasks::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions