X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/e91ef54cc9f8ce6b264bced8191275b6a33e594f..refs/pull/2791/head:/app/Http/Controllers/ChapterExportController.php diff --git a/app/Http/Controllers/ChapterExportController.php b/app/Http/Controllers/ChapterExportController.php index 0c86f8548..52d087442 100644 --- a/app/Http/Controllers/ChapterExportController.php +++ b/app/Http/Controllers/ChapterExportController.php @@ -1,6 +1,6 @@ chapterRepo = $chapterRepo; - $this->exportService = $exportService; - parent::__construct(); + $this->exportFormatter = $exportFormatter; } /** @@ -29,7 +28,7 @@ class ChapterExportController extends Controller public function pdf(string $bookSlug, string $chapterSlug) { $chapter = $this->chapterRepo->getBySlug($bookSlug, $chapterSlug); - $pdfContent = $this->exportService->chapterToPdf($chapter); + $pdfContent = $this->exportFormatter->chapterToPdf($chapter); return $this->downloadResponse($pdfContent, $chapterSlug . '.pdf'); } @@ -41,7 +40,7 @@ class ChapterExportController extends Controller public function html(string $bookSlug, string $chapterSlug) { $chapter = $this->chapterRepo->getBySlug($bookSlug, $chapterSlug); - $containedHtml = $this->exportService->chapterToContainedHtml($chapter); + $containedHtml = $this->exportFormatter->chapterToContainedHtml($chapter); return $this->downloadResponse($containedHtml, $chapterSlug . '.html'); } @@ -52,7 +51,7 @@ class ChapterExportController extends Controller public function plainText(string $bookSlug, string $chapterSlug) { $chapter = $this->chapterRepo->getBySlug($bookSlug, $chapterSlug); - $chapterText = $this->exportService->chapterToPlainText($chapter); + $chapterText = $this->exportFormatter->chapterToPlainText($chapter); return $this->downloadResponse($chapterText, $chapterSlug . '.txt'); } }