public function SlickListBuilder::buildRow in Slick Carousel 8
Same name and namespace in other branches
- 8.2 slick_ui/src/Controller/SlickListBuilder.php \Drupal\slick_ui\Controller\SlickListBuilder::buildRow()
Builds a row for an entity in the entity listing.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.
Return value
array A render array structure of fields for this entity.
Overrides DraggableListBuilder::buildRow
See also
\Drupal\Core\Entity\EntityListBuilder::render()
File
- slick_ui/
src/ Controller/ SlickListBuilder.php, line 78
Class
- SlickListBuilder
- Provides a listing of Slick optionsets.
Namespace
Drupal\slick_ui\ControllerCode
public function buildRow(EntityInterface $entity) {
$skins = $this->manager
->getSkins()['skins'];
$skin = $entity
->getSkin();
$row['label'] = Html::escape($entity
->label());
$row['breakpoints']['#markup'] = $entity
->getBreakpoints();
$row['group']['#markup'] = $entity
->getGroup() ?: $this
->t('All');
$row['lazyload']['#markup'] = $entity
->getSetting('lazyLoad') ?: $this
->t('None');
$markup = $skin;
if (isset($skins[$skin]['description'])) {
// No need to re-translate, as already translated at SlickSkin.php.
$markup .= '<br />' . Html::escape($skins[$skin]['description']);
}
$row['skin']['#markup'] = $markup;
return $row + parent::buildRow($entity);
}