You are here

public function FiveStarWidget::getInitialVotingElement in Votingapi Widgets 8

Get initial element.

Overrides VotingApiWidgetBase::getInitialVotingElement

File

src/Plugin/votingapi_widget/FiveStarWidget.php, line 56

Class

FiveStarWidget
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 fivestar">';
  $form['value']['#attached'] = [
    'library' => [
      'votingapi_widgets/fivestar',
    ],
  ];
  $form['value']['#suffix'] = '</div>';
  $form['value']['#attributes'] = [
    'data-style' => 'default',
    'data-is-edit' => 1,
  ];
}