| 12345678910111213141516171819 |
- <?php /** @noinspection PhpUnhandledExceptionInspection */
- namespace App;
- use RuntimeException;
- /**
- * @var int $id
- */
- $product = Product::require($id);
- if($product->hasBrochure()) {
- header("Content-Type: application/pdf");
- readfile($product->getBrochurePath());
- exit(0);
- }
- http_response_code(404);
- throw new RuntimeException(__("Brochure not found."));
|