]> BookStack Code Mirror - bookstack/blobdiff - app/Book.php
Page Attachments - Improved UI, Now initially complete
[bookstack] / app / Book.php
index af6d59bfd8f28b35150ee45af9c73d42baaa3e3c..aa2dee9c0a4540f018857e0d7fcb8693c630250b 100644 (file)
@@ -7,10 +7,14 @@ class Book extends Entity
 
     /**
      * Get the url for this book.
+     * @param string|bool $path
      * @return string
      */
-    public function getUrl()
+    public function getUrl($path = false)
     {
+        if ($path !== false) {
+            return baseUrl('/books/' . $this->slug . '/' . trim($path, '/'));
+        }
         return baseUrl('/books/' . $this->slug);
     }