public function BlazyEntityInterface::build in Blazy 7
Same name and namespace in other branches
- 8.2 src/BlazyEntityInterface.php \Drupal\blazy\BlazyEntityInterface::build()
Build image/video preview either using theme_blazy(), or view builder.
This is alternative to Drupal\blazy\BlazyFormatter used outside field formatters, such as Views field, or Entity Browser displays, etc.
Parameters
array $data: An array of data containing settings, and image item.
object $entity: The media entity, else file entity to be associated to media if any.
string $fallback: The fallback string to display such as file name or entity label.
Return value
array The renderable array of theme_blazy(), or view builder, else empty array.
File
- src/
BlazyEntityInterface.php, line 26
Class
- BlazyEntityInterface
- Provides common entity utilities to work with field details.
Namespace
Drupal\blazyCode
public function build(array $data, $entity, $fallback = '');