public function WebformOptionsListBuilder::render in Webform 8.5
Same name and namespace in other branches
- 6.x src/WebformOptionsListBuilder.php \Drupal\webform\WebformOptionsListBuilder::render()
Builds the entity listing as renderable array for table.html.twig.
@todo Add a link to add a new item to the #empty text.
Overrides EntityListBuilder::render
File
- src/
WebformOptionsListBuilder.php, line 70
Class
- WebformOptionsListBuilder
- Defines a class to build a listing of webform options entities.
Namespace
Drupal\webformCode
public function render() {
// Handler autocomplete redirect.
if ($this->keys && preg_match('#\\(([^)]+)\\)$#', $this->keys, $match)) {
if ($webform_options = $this
->getStorage()
->load($match[1])) {
return new RedirectResponse($webform_options
->toUrl()
->setAbsolute(TRUE)
->toString());
}
}
$build = [];
// Filter form.
$build['filter_form'] = $this
->buildFilterForm();
// Display info.
$build['info'] = $this
->buildInfo();
// Table.
$build += parent::render();
$build['table']['#sticky'] = TRUE;
// Attachments.
$build['#attached']['library'][] = 'webform/webform.admin.dialog';
return $build;
}