BlazyFileFormatter.php in Blazy 8
File
src/Plugin/Field/FieldFormatter/BlazyFileFormatter.php
View source
<?php
namespace Drupal\blazy\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\blazy\Dejavu\BlazyVideoTrait;
class BlazyFileFormatter extends BlazyFileFormatterBase {
use BlazyFormatterTrait;
use BlazyVideoTrait;
public function getScopedFormElements() {
return [
'fieldable_form' => TRUE,
'multimedia' => TRUE,
'view_mode' => $this->viewMode,
] + parent::getScopedFormElements();
}
public static function isApplicable(FieldDefinitionInterface $field_definition) {
return $field_definition
->getFieldStorageDefinition()
->getSetting('target_type') === 'file';
}
}
Classes
Name |
Description |
BlazyFileFormatter |
Plugin implementation of the 'Blazy File' to get videos within images/files. |