X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/1b46c19849820d4d500f0d9e7424228ab5f0712c..refs/pull/205/head:/app/Book.php diff --git a/app/Book.php b/app/Book.php index 919af80a5..aa2dee9c0 100644 --- a/app/Book.php +++ b/app/Book.php @@ -7,11 +7,15 @@ class Book extends Entity /** * Get the url for this book. + * @param string|bool $path * @return string */ - public function getUrl() + public function getUrl($path = false) { - return '/books/' . $this->slug; + if ($path !== false) { + return baseUrl('/books/' . $this->slug . '/' . trim($path, '/')); + } + return baseUrl('/books/' . $this->slug); } /*