Example #1
0
 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');
 }
Example #2
0
 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;
 }
Example #3
0
 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;
     }
 }