VocabularyListBuilder::render

public VocabularyListBuilder::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 DraggableListBuilder::render

File

core/modules/taxonomy/src/VocabularyListBuilder.php, line 73

Class

VocabularyListBuilder
Defines a class to build a listing of taxonomy vocabulary entities.

Namespace

Drupal\taxonomy

Code

public function render() {
  $entities = $this->load();
  // If there are not multiple vocabularies, disable dragging by unsetting the
  // weight key.
  if (count($entities) <= 1) {
    unset($this->weightKey);
  }
  $build = parent::render();
  $build['table']['#empty'] = t('No vocabularies available. <a href=":link">Add vocabulary</a>.', array(':link' => \Drupal::url('entity.taxonomy_vocabulary.add_form')));
  return $build;
}
doc_Drupal
2016-10-29 09:56:28
Comments
Leave a Comment

Please login to continue.