LukeTowers / oc-snappypdf-plugin

SnappyPDF integration for OctoberCMS
MIT License
12 stars 8 forks source link

How can i use layouts ? #9

Closed lucacalcaterra closed 4 years ago

lucacalcaterra commented 4 years ago

Hi! Thanks for your works...

I cannot figure out ...There is a way to use twig layouts since parser doesn't support twig extends ?

Thanks !

LukeTowers commented 4 years ago

Render the page with the CMS controller instead:

$controller = new \Cms\Classes\Controller();
$html = $controller->run('/url-to-page')->getContent();

or

$page = \Cms\Classes\Page::loadCached(\Cms\Classes\Theme::getActiveTheme(), 'my-page.htm');
$controller = new \Cms\Classes\Controller();
$html = $controller->runPage($page);