BlazyFormatterTest.php in Blazy 8
Same filename in this branch
Same filename and directory in other branches
Namespace
Drupal\blazy_testFile
tests/modules/blazy_test/src/BlazyFormatterTest.phpView source
<?php
namespace Drupal\blazy_test;
use Drupal\blazy\BlazyFormatterManager;
/**
* Implements GridStackFormatterInterface.
*/
class BlazyFormatterTest extends BlazyFormatterManager 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;
}
}
Classes
Name | Description |
---|---|
BlazyFormatterTest | Implements GridStackFormatterInterface. |