Accordion.php in Double Field 8.3
File
src/Plugin/Field/FieldFormatter/Accordion.php
View source
<?php
namespace Drupal\double_field\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldItemListInterface;
class Accordion extends Base {
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
@trigger_error('Accordion formatter is deprecated in double_field:8.x-3.4 and will be removed in double_field:8.x-4.0. See https://www.drupal.org/node/3067969', E_USER_DEPRECATED);
}
public function viewElements(FieldItemListInterface $items, $langcode) {
$element[0] = [
'#theme' => 'double_field_accordion',
'#items' => $items,
'#settings' => $this
->getSettings(),
'#attached' => [
'library' => [
'double_field/accordion',
],
],
];
return $element;
}
}
Classes
Name |
Description |
Accordion Deprecated |
Plugin implementations for 'accordion' formatter. |