public BookController::bookRender()
Prints a listing of all books.
Return value
array A render array representing the listing of all books content.
File
- core/modules/book/src/Controller/BookController.php, line 116
Class
- BookController
- Controller routines for book routes.
Namespace
Drupal\book\Controller
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 | public function bookRender() { $book_list = array (); foreach ( $this ->bookManager->getAllBooks() as $book ) { $book_list [] = $this ->l( $book [ 'title' ], $book [ 'url' ]); } return array ( '#theme' => 'item_list' , '#items' => $book_list , '#cache' => [ 'tags' => \Drupal::entityManager()->getDefinition( 'node' )->getListCacheTags(), ], ); } |
Please login to continue.