public function chapterToContainedHtml(Chapter $chapter)
{
$pages = $this->entityRepo->getChapterChildren($chapter);
- $pages->each(function($page) {
+ $pages->each(function ($page) {
$page->html = $this->entityRepo->renderPage($page);
});
$html = view('chapters/export', [
public function chapterToPdf(Chapter $chapter)
{
$pages = $this->entityRepo->getChapterChildren($chapter);
- $pages->each(function($page) {
+ $pages->each(function ($page) {
$page->html = $this->entityRepo->renderPage($page);
});
$html = view('chapters/export', [
$pathString = public_path(trim($relString, '/'));
}
- if ($isLocal && !file_exists($pathString)) continue;
+ if ($isLocal && !file_exists($pathString)) {
+ continue;
+ }
try {
if ($isLocal) {
$imageContent = file_get_contents($pathString);
$imageContent = curl_exec($ch);
$err = curl_error($ch);
curl_close($ch);
- if ($err) throw new \Exception("Image fetch failed, Received error: " . $err);
+ if ($err) {
+ throw new \Exception("Image fetch failed, Received error: " . $err);
+ }
}
$imageEncoded = 'data:image/' . pathinfo($pathString, PATHINFO_EXTENSION) . ';base64,' . base64_encode($imageContent);
$newImageString = str_replace($srcString, $imageEncoded, $oldImgString);
}
return $text;
}
-
}
-
-
-
-
-
-
-
-
-
-
-
-