Example #1
0
 /**
  * @param Book $book
  * @return BookPage[]|null
  */
 function getBookPages(Book $book)
 {
     $files = call_user_func($this->finders['findBookPageFiles'], $book->getPath() . '/pages');
     $result = new NamedList();
     foreach ($files as $file) {
         $page = new BookPage($this->project, $book, $file, true);
         if ($page->isLoaded()) {
             $result->add($page->getShortName(), $page);
         }
     }
     return $result;
 }
Example #2
0
 /**
  * Return book page URL
  *
  * @param string $book_name
  * @param string $page_slug
  * @return string
  */
 private static function getBookPageUrl($book_name, $page_slug)
 {
     return self::pageLevelToPrefix(self::$current_element->getPageLevel()) . 'books/' . $book_name . '/' . $page_slug . '.html';
 }