public function render($viewFile, array $params, $layout = null) { extract($params); if ($layout !== null) { include \Application::getFolders()->get('layouts') . "/{$layout}.php"; } $this->pdf = new \fpdf\FPDF(); include $this->getAbsoluteViewFileUrl($viewFile); return $this->pdf->Output('', 'S'); }
public function __construct($module = null) { if ($module === null) { $module = \Application::getModule(); } $modulePath = \Application::getFolders()->get('modules') . '/' . str_replace('\\', '/', $module) . '/View/'; if (!file_exists($modulePath)) { throw new FatalException('Path not found: ' . $modulePath); } $this->modulePath = $modulePath; }
public function render($viewFile, array $params, $layout = null) { extract($params); ob_start(); include $this->getAbsoluteViewFileUrl($viewFile); $content = ob_get_clean(); if ($layout !== null) { ob_start(); include \Application::getFolders()->get('layouts') . "/{$layout}.php"; return ob_get_clean(); } else { return $content; } }