public function BookController::bookRender

Prints a listing of all books.

Return value

string A HTML-formatted string with the listing of all books content.

1 string reference to 'BookController::bookRender'
book.routing.yml in drupal/core/modules/book/book.routing.yml
drupal/core/modules/book/book.routing.yml

File

drupal/core/modules/book/lib/Drupal/book/Controller/BookController.php, line 80
Contains \Drupal\book\Controller\BookController.

Class

BookController
Controller routines for book routes.

Namespace

Drupal\book\Controller

Code

public function bookRender() {
  $book_list = array();
  foreach ($this->bookManager
    ->getAllBooks() as $book) {
    $book_list[] = l($book['title'], $book['href'], $book['options']);
  }
  $item_list = array(
    '#theme' => 'item_list',
    '#items' => $book_list,
  );
  return drupal_render($item_list);
}