Example #1
0
 /**
  * View support.
  * @param  string $file
  * @param  array  $data
  * @return void
  */
 public final function view(string $file, array $data = null)
 {
     if (!$this->useView || !$this->view) {
         throw new ServiceException("Set service \$useView property as TRUE and be sure " . "that already included 'froq/froq-view' module via Composer.");
     }
     $this->view->setFile($file);
     if ($this->useViewPartials) {
         $this->view->setFileHead();
         $this->view->setFileFoot();
     }
     $this->view->displayAll($data);
 }