NodeAddToAnyShare.php in AddToAny Share Buttons 8
File
src/Plugin/views/field/NodeAddToAnyShare.php
View source
<?php
namespace Drupal\addtoany\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;
class NodeAddToAnyShare extends FieldPluginBase {
public function query() {
}
public function render(ResultRow $values) {
$entity = $values->_entity;
if ($entity
->access('view')) {
$data = addtoany_create_entity_data($entity);
return [
'#addtoany_html' => \Drupal::token()
->replace($data['addtoany_html'], [
'node' => $entity,
]),
'#link_url' => $data['link_url'],
'#link_title' => $data['link_title'],
'#button_setting' => $data['button_setting'],
'#button_image' => $data['button_image'],
'#universal_button_placement' => $data['universal_button_placement'],
'#buttons_size' => $data['buttons_size'],
'#theme' => 'addtoany_standard',
];
}
}
}