/** * @param array $data * @param bool $merge * @return mixed * @throws \Exception */ public function render(array $data = [], bool $merge = false) { if (empty($this->template)) { throw new \Exception("Please set a template to render"); } $data = $merge === true ? array_merge($this->data, $data) : $data; $data = empty($data) ? $this->data : $data; if (!preg_match(sprintf('#%s$#i', preg_quote($this->extension)), $this->template)) { $this->template .= $this->extension; } return $this->renderer->render($this->template, $data); }
/** * */ public function render() { $this->renderService->render(); }