class BlazyImageFormatter in Blazy 7
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldFormatter/BlazyImageFormatter.php \Drupal\blazy\Plugin\Field\FieldFormatter\BlazyImageFormatter
Plugin for the Blazy image formatter.
Hierarchy
- class \Drupal\blazy\Plugin\Field\FieldFormatter\FormatterBase implements FormatterInterface
- class \Drupal\blazy\Plugin\Field\FieldFormatter\BlazyFormatterBase
- class \Drupal\blazy\Plugin\Field\FieldFormatter\BlazyFormatterBlazy
- class \Drupal\blazy\Plugin\Field\FieldFormatter\BlazyImageFormatter uses BlazyFormatterTrait
- class \Drupal\blazy\Plugin\Field\FieldFormatter\BlazyFormatterBlazy
- class \Drupal\blazy\Plugin\Field\FieldFormatter\BlazyFormatterBase
Expanded class hierarchy of BlazyImageFormatter
File
- src/
Plugin/ Field/ FieldFormatter/ BlazyImageFormatter.php, line 8
Namespace
Drupal\blazy\Plugin\Field\FieldFormatterView source
class BlazyImageFormatter extends BlazyFormatterBlazy {
use BlazyFormatterTrait;
/**
* {@inheritdoc}
*/
protected function getCaption($entity, $field_name, $settings) {
return empty($entity->{$field_name}) ? [] : [
'#markup' => filter_xss_admin($entity->{$field_name}),
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlazyFormatterBase:: |
public static | function |
Returns default settings. Overrides FormatterBase:: |
1 |
BlazyFormatterBase:: |
protected | function | Converts $items array to object for easy D8 -> D7 backports. | 1 |
BlazyFormatterBase:: |
public | function |
Returns required form elements for the current formatter. Overrides FormatterBase:: |
2 |
BlazyFormatterBase:: |
public | function |
Defines the scope for the form elements. Overrides FormatterBase:: |
2 |
BlazyFormatterBase:: |
public | function |
Implements hook_field_formatter_settings_form(). Overrides FormatterBase:: |
1 |
BlazyFormatterBlazy:: |
public | function |
Returns the blazy admin service for blazy-related module. Overrides BlazyFormatterBase:: |
|
BlazyFormatterBlazy:: |
public | function |
Build individual item if so configured such as for file entity goodness. Overrides BlazyFormatterBase:: |
1 |
BlazyFormatterBlazy:: |
public | function | Build the Blazy elements for image and file entity/ media. | |
BlazyFormatterBlazy:: |
public | function |
Implements hook_field_formatter_view(). Overrides FormatterBase:: |
|
BlazyFormatterBlazy:: |
public | function |
Constructs a BlazyFormatter instance. Overrides FormatterBase:: |
|
BlazyFormatterTrait:: |
protected | property | The blazy-related formatter service. | |
BlazyFormatterTrait:: |
protected | property | The blazy field formatter manager. | |
BlazyFormatterTrait:: |
public | function | Returns the blazy-related formatter. | |
BlazyFormatterTrait:: |
public | function | Returns the blazy service. | |
BlazyFormatterTrait:: |
public | function | ||
BlazyImageFormatter:: |
protected | function |
Returns the captions. Overrides BlazyFormatterBlazy:: |
|
FormatterBase:: |
protected | property | The blazy-related admin formatter service. | |
FormatterBase:: |
protected | property | Whether default settings have been merged into the current $settings. | |
FormatterBase:: |
protected | property | The field definition. | |
FormatterBase:: |
protected | property | The field display. | |
FormatterBase:: |
protected | property | The field instance. | |
FormatterBase:: |
protected | property | The form settings. | |
FormatterBase:: |
protected | property | True if the field cardinality equals -1. | |
FormatterBase:: |
protected | property | The known hard-coded entities. | |
FormatterBase:: |
protected | property | The langcode. | |
FormatterBase:: |
protected | property | The blazy formatter plugin id. | |
FormatterBase:: |
protected | property | The formatter settings. | |
FormatterBase:: |
protected | property | The view mode. | |
FormatterBase:: |
public | function | Builds the settings. | 1 |
FormatterBase:: |
public | function | Implements hook_field_formatter_settings_form(). | |
FormatterBase:: |
public | function | ||
FormatterBase:: |
public | function | Gets html settings. | |
FormatterBase:: |
public | function | Gets formatter plugin id. | |
FormatterBase:: |
public | function | ||
FormatterBase:: |
public | function | Gets formatter settings. | |
FormatterBase:: |
protected | function | Merges default settings values into $settings. | |
FormatterBase:: |
public | function | Sets html settings. | |
FormatterBase:: |
public | function | ||
FormatterBase:: |
public | function | Sets formatter settings. | |
FormatterBase:: |
protected | function | Setup common variables across different hooks. | |
FormatterBase:: |
public | function | Implements hook_field_formatter_view(). |