You are here

public function VoteUpDownWidgetBase::getWidgetTemplateVars in Vote Up/Down 8

Returns the path to the widget template to be used.

Parameters

$base_path:

$variables:

Return value

array

Overrides VoteUpDownWidgetInterface::getWidgetTemplateVars

1 call to VoteUpDownWidgetBase::getWidgetTemplateVars()
VoteUpDownWidgetBase::build in src/Plugin/VoteUpDownWidgetBase.php
@fixme Do not use camelcase on variables, and fix coding standards.

File

src/Plugin/VoteUpDownWidgetBase.php, line 42

Class

VoteUpDownWidgetBase
Defines a plugin base implementation that corresponding plugins will extend.

Namespace

Drupal\vud\Plugin

Code

public function getWidgetTemplateVars($base_path, &$variables) {
  $variables['#template_path'] = $base_path . '/widgets/' . $this
    ->getWidgetId() . '/widget.html.twig';
  array_push($variables['#attached']['library'], 'vud/' . $this
    ->getWidgetId());
  return $variables;
}