예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function build()
 {
     $route_name = $this->routeMatch->getRouteName();
     $local_actions = $this->localActionManager->getActionsForRoute($route_name);
     if (empty($local_actions)) {
         return [];
     }
     return $local_actions;
 }
예제 #2
0
 /**
  * Builds the local actions for this listing.
  *
  * @return array
  *   An array of local actions for this listing.
  */
 protected function buildLocalActions()
 {
     $build = $this->localActionManager->getActionsForRoute($this->routeMatch->getRouteName());
     // Without this workaround, the action links will be rendered as <li> with
     // no wrapping <ul> element.
     if (!empty($build)) {
         $build['#prefix'] = '<ul class="action-links">';
         $build['#suffix'] = '</ul>';
     }
     return $build;
 }