protected function renderTemplate($path = false)
    {
        if(!$this->templateEngine) {
            throw new \Exception('template engine not injected');
        }
        if(!$path) {
            $path = sprintf('%s/%s/%s', AREA, $this->name, $this->action);
        }
        $this->setCommonTemplateParameters();
        $html = $this->templateEngine->render($path, $this->templateParameters);
        $this->httpStream->write($html);
        return $html;
    }