href = $href; $this->text = $text; $this->icon = $icon; $this->localizer = $localizer; $this->accessKeyHint = $accessKeyHint; } /** * @inheritDoc */ public function getTemplateData(): array { $localizer = $this->localizer; $accessKeyHint = $this->accessKeyHint; $additionalAttributes = []; if ( $localizer ) { $msg = $localizer->msg( $accessKeyHint . '-label' ); if ( $msg->exists() ) { $additionalAttributes[ 'aria-label' ] = $msg->text(); } } return [ 'icon' => $this->icon, 'text' => $this->text, 'href' => $this->href, 'html-attributes' => $localizer && $accessKeyHint ? Html::expandAttributes( Linker::tooltipAndAccesskeyAttribs( $accessKeyHint, [], [], $localizer ) + $additionalAttributes ) : '', ]; } }