Skip to content

Commit aa125c0

Browse files
authored
Improve the custom view example
1 parent a2b1dbe commit aa125c0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/en/views.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,15 @@ use Cake\View\View;
756756

757757
class PdfView extends View
758758
{
759+
protected $layoutPath = 'pdf';
760+
761+
protected $subDir = 'pdf';
762+
763+
public static function contentType(): string
764+
{
765+
return 'application/pdf';
766+
}
767+
759768
public function render(?string $view = null, ?string $layout = null): string
760769
{
761770
// Custom logic here.

0 commit comments

Comments
 (0)