public function renderTemplate($path, array $data = [], $class = null)
    {
        if (file_exists($path)) {
            return $this->doRender($path, $data, $class);
        }
        throw new RuntimeException(__METHOD__.' needs a valid template path as first argument.');
    }