X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/1b46c19849820d4d500f0d9e7424228ab5f0712c..refs/pull/263/head:/app/Book.php diff --git a/app/Book.php b/app/Book.php index 919af80a5..91f74ca64 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/' . urlencode($this->slug) . '/' . trim($path, '/')); + } + return baseUrl('/books/' . urlencode($this->slug)); } /*