public function BlazyStyleBaseTrait::getFieldRenderable in Blazy 8.2
Same name and namespace in other branches
- 8 src/Dejavu/BlazyStyleBaseTrait.php \Drupal\blazy\Dejavu\BlazyStyleBaseTrait::getFieldRenderable()
- 7 src/Dejavu/BlazyStyleBaseTrait.php \Drupal\blazy\Dejavu\BlazyStyleBaseTrait::getFieldRenderable()
Returns the renderable array of field containing rendered and raw data.
1 call to BlazyStyleBaseTrait::getFieldRenderable()
- BlazyStyleBaseTrait::getFirstImage in src/
Dejavu/ BlazyStyleBaseTrait.php - Returns the first Blazy formatter found, to save image dimensions once.
File
- src/
Dejavu/ BlazyStyleBaseTrait.php, line 147
Class
- BlazyStyleBaseTrait
- A Trait common for optional views style plugins.
Namespace
Drupal\blazy\DejavuCode
public function getFieldRenderable($row, $index, $field_name = '', $multiple = FALSE) {
// Be sure to not check "Use field template" under "Style settings" to have
// renderable array to work with, otherwise flattened string!
$result = isset($this->view->field[$field_name]) ? $this->view->field[$field_name]
->getItems($row) : [];
return empty($result) ? [] : ($multiple ? $result : $result[0]);
}