You are here

public function LikeWidget::getInitialVotingElement in Votingapi Widgets 8

Get initial element.

Overrides VotingApiWidgetBase::getInitialVotingElement

File

src/Plugin/votingapi_widget/LikeWidget.php, line 52

Class

LikeWidget
Assigns ownership of a node to a user.

Namespace

Drupal\votingapi_widgets\Plugin\votingapi_widget

Code

public function getInitialVotingElement(array &$form) {
  $form['value']['#prefix'] = '<div class="votingapi-widgets like">';
  $form['value']['#attached'] = [
    'library' => [
      'votingapi_widgets/like',
    ],
  ];
  $form['value']['#suffix'] = '</div>';
}