public function LikeWidget::buildForm in Votingapi Widgets 8
Vote form.
Overrides VotingApiWidgetInterface::buildForm
File
- src/
Plugin/ votingapi_widget/ LikeWidget.php, line 26
Class
- LikeWidget
- Assigns ownership of a node to a user.
Namespace
Drupal\votingapi_widgets\Plugin\votingapi_widgetCode
public function buildForm($entity_type, $entity_bundle, $entity_id, $vote_type, $field_name, $settings) {
$form = $this
->getForm($entity_type, $entity_bundle, $entity_id, $vote_type, $field_name, $settings);
$build = [
'rating' => [
'#theme' => 'container',
'#attributes' => [
'class' => [
'votingapi-widgets',
'like',
$settings['readonly'] === 1 ? 'read_only' : '',
],
],
'#children' => [
'form' => $form,
],
],
'#attached' => [
'library' => [
'votingapi_widgets/like',
],
],
];
return $build;
}