public function LocalTaskDefault::getOptions in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Menu/LocalTaskDefault.php \Drupal\Core\Menu\LocalTaskDefault::getOptions()
Returns options for rendering a link to the local task.
Parameters
\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.
Return value
array An associative array of options.
Overrides LocalTaskInterface::getOptions
File
- core/
lib/ Drupal/ Core/ Menu/ LocalTaskDefault.php, line 110 - Contains \Drupal\Core\Menu\LocalTaskDefault.
Class
- LocalTaskDefault
- Default object used for LocalTaskPlugins.
Namespace
Drupal\Core\MenuCode
public function getOptions(RouteMatchInterface $route_match) {
$options = $this->pluginDefinition['options'];
if ($this->active) {
if (empty($options['attributes']['class']) || !in_array('is-active', $options['attributes']['class'])) {
$options['attributes']['class'][] = 'is-active';
}
}
return (array) $options;
}