public function BookManager::bookTreeOutput in Drupal 10        
                          
                  
                        Same name and namespace in other branches
- 8 core/modules/book/src/BookManager.php \Drupal\book\BookManager::bookTreeOutput()
- 9 core/modules/book/src/BookManager.php \Drupal\book\BookManager::bookTreeOutput()
File
 
   - core/modules/book/src/BookManager.php, line 577
Class
  
  - BookManager 
- Defines a book manager.
Namespace
  Drupal\book
Code
public function bookTreeOutput(array $tree) {
  $items = $this
    ->buildItems($tree);
  $build = [];
  if ($items) {
    
    $build['#sorted'] = TRUE;
    
    $item = end($items);
    
    $build['#theme'] = 'book_tree__book_toc_' . $item['original_link']['bid'];
    $build['#items'] = $items;
    
    $build['#cache']['tags'][] = 'config:system.book.' . $item['original_link']['bid'];
  }
  return $build;
}