class BlazyFormatterTest in Blazy 8.2
Same name in this branch
- 8.2 tests/src/Kernel/BlazyFormatterTest.php \Drupal\Tests\blazy\Kernel\BlazyFormatterTest
- 8.2 tests/modules/blazy_test/src/BlazyFormatterTest.php \Drupal\blazy_test\BlazyFormatterTest
Same name and namespace in other branches
- 8 tests/modules/blazy_test/src/BlazyFormatterTest.php \Drupal\blazy_test\BlazyFormatterTest
Implements GridStackFormatterInterface.
Hierarchy
- class \Drupal\blazy\BlazyManagerBase implements BlazyManagerInterface uses DependencySerializationTrait, StringTranslationTrait
- class \Drupal\blazy\BlazyManager implements TrustedCallbackInterface
- class \Drupal\blazy\BlazyFormatter implements BlazyFormatterInterface
- class \Drupal\blazy_test\BlazyFormatterTest implements BlazyFormatterTestInterface
- class \Drupal\blazy\BlazyFormatter implements BlazyFormatterInterface
- class \Drupal\blazy\BlazyManager implements TrustedCallbackInterface
Expanded class hierarchy of BlazyFormatterTest
1 string reference to 'BlazyFormatterTest'
- blazy_test.services.yml in tests/
modules/ blazy_test/ blazy_test.services.yml - tests/modules/blazy_test/blazy_test.services.yml
1 service uses BlazyFormatterTest
- blazy_test.formatter in tests/
modules/ blazy_test/ blazy_test.services.yml - Drupal\blazy_test\BlazyFormatterTest
File
- tests/
modules/ blazy_test/ src/ BlazyFormatterTest.php, line 10
Namespace
Drupal\blazy_testView source
class BlazyFormatterTest extends BlazyFormatter implements BlazyFormatterTestInterface {
/**
* Gets the thumbnail image using theme_image_style().
*
* @param array $settings
* The array containing: thumbnail_style, etc.
* @param object $item
* The \Drupal\image\Plugin\Field\FieldType\ImageItem object.
*
* @return array
* The renderable array of thumbnail image.
*/
public function getThumbnail(array $settings = [], $item = NULL) {
$thumbnail = [];
if (!empty($settings['uri'])) {
$thumbnail = [
'#theme' => 'image_style',
'#style_name' => isset($settings['thumbnail_style']) ? $settings['thumbnail_style'] : 'thumbnail',
'#uri' => $settings['uri'],
'#item' => $item,
];
}
return $thumbnail;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlazyFormatter:: |
protected | property | Returns available styles with crop in the effect name. | |
BlazyFormatter:: |
protected | property | Checks if the image style contains crop in the effect name. | |
BlazyFormatter:: |
private | property | Checks if image dimensions are set. | |
BlazyFormatter:: |
public | function |
Modifies the field formatter settings inherited by child elements. Overrides BlazyFormatterInterface:: |
|
BlazyFormatter:: |
private | function | Returns available image styles with crop in the name. | |
BlazyFormatter:: |
public | function |
Extract the first image item to build colorbox/zoom-like gallery. Overrides BlazyFormatterInterface:: |
|
BlazyFormatter:: |
public | function |
Checks if an image style contains crop effect. Overrides BlazyFormatterInterface:: |
|
BlazyFormatter:: |
public | function |
Modifies the field formatter settings not inherited by child elements. Overrides BlazyFormatterInterface:: |
|
BlazyFormatter:: |
public | function |
Modifies the field formatter settings inherited by child elements. Overrides BlazyFormatterInterface:: |
|
BlazyFormatter:: |
protected | function | Sets dimensions once to reduce method calls, if image style contains crop. | |
BlazyFormatterTest:: |
public | function | Gets the thumbnail image using theme_image_style(). | |
BlazyManager:: |
private | function | Prepares CSS background image. | |
BlazyManager:: |
public | function | Returns the contents using theme_field(), or theme_item_list(). | |
BlazyManager:: |
public | function | Build captions for both old image, or media entity. | |
BlazyManager:: |
protected | function | Build out (rich media) content. | |
BlazyManager:: |
private | function | Build out image, or anything related, including cache, CSS background, etc. | |
BlazyManager:: |
private | function | Build out (Responsive) image. | |
BlazyManager:: |
private | function | Build out Responsive image. | |
BlazyManager:: |
protected | function | Build thumbnails, also to provide placeholder for blur effect. | |
BlazyManager:: |
public | function | Returns the enforced rich media content, or media using theme_blazy(). | |
BlazyManager:: |
public | function | Deprecated method. | |
BlazyManager:: |
protected | function | Prepares Blazy settings. | |
BlazyManager:: |
protected | function | Prepares the Blazy output as a structured array ready for ::renderer(). | |
BlazyManager:: |
protected | function | Prepares Blazy outputs, extract items as indices. | |
BlazyManager:: |
public | function | Builds the Blazy image as a structured array ready for ::renderer(). | |
BlazyManager:: |
public | function | Builds the Blazy outputs as a structured array ready for ::renderer(). | |
BlazyManager:: |
protected | function | Build thumbnails, also to provide placeholder for blur effect. | |
BlazyManager:: |
public static | function |
Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: |
|
BlazyManagerBase:: |
protected | property | The cache backend. | |
BlazyManagerBase:: |
protected | property | The config factory. | |
BlazyManagerBase:: |
protected | property | The entity repository service. | |
BlazyManagerBase:: |
protected | property | The entity type manager service. | |
BlazyManagerBase:: |
protected | property | The language manager. | |
BlazyManagerBase:: |
protected | property | The module handler service. | |
BlazyManagerBase:: |
protected | property | The renderer. | |
BlazyManagerBase:: |
protected | property | The app root. | |
BlazyManagerBase:: |
public | function |
Returns array of needed assets suitable for #attached property. Overrides BlazyManagerInterface:: |
|
BlazyManagerBase:: |
public | function | Collects defined skins as registered via hook_MODULE_NAME_skins_info(). | |
BlazyManagerBase:: |
public | function | Returns any config, or keyed by the $setting_name. | |
BlazyManagerBase:: |
public static | function | ||
BlazyManagerBase:: |
public | function | Returns a shortcut for loading a config entity: image_style, slick, etc. | |
BlazyManagerBase:: |
public | function | Returns a shortcut for loading multiple configuration entities. | |
BlazyManagerBase:: |
public | function | Returns the cache. | |
BlazyManagerBase:: |
public | function | Return the cache metadata common for all blazy-related modules. | |
BlazyManagerBase:: |
public | function | Returns the common UI settings inherited down to each item. | |
BlazyManagerBase:: |
public | function | Returns the config factory. | |
BlazyManagerBase:: |
public | function | Returns the entity repository service. | |
BlazyManagerBase:: |
public | function | Returns the entity type manager. | |
BlazyManagerBase:: |
public | function |
Returns the supported image effects. Overrides BlazyManagerInterface:: |
|
BlazyManagerBase:: |
public | function |
Returns drupalSettings for IO. Overrides BlazyManagerInterface:: |
|
BlazyManagerBase:: |
public | function |
Gets the supported lightboxes. Overrides BlazyManagerInterface:: |
|
BlazyManagerBase:: |
public | function | Returns the module handler. | |
BlazyManagerBase:: |
public | function | Returns the renderer. | |
BlazyManagerBase:: |
public | function | Returns the Responsive image styles and caches tags. | |
BlazyManagerBase:: |
public | function |
Checks for Blazy formatter such as from within a Views style plugin. Overrides BlazyManagerInterface:: |
|
BlazyManagerBase:: |
protected | function | Collects the first found Blazy formatter settings within Views fields. | |
BlazyManagerBase:: |
public | function | Returns the language manager service. | |
BlazyManagerBase:: |
public | function | Returns the app root. | |
BlazyManagerBase:: |
protected | function | Provides attachments and cache common for all blazy-related modules. | |
BlazyManagerBase:: |
public | function | Sets the language manager service. | |
BlazyManagerBase:: |
public | function | Sets dimensions once to reduce method calls for Responsive image. | |
BlazyManagerBase:: |
public | function | Sets app root service. | |
BlazyManagerBase:: |
public | function | Constructs a BlazyManager object. | |
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
TrustedCallbackInterface:: |
constant | Untrusted callbacks throw exceptions. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger E_USER_WARNING errors. |