Ergo\View\Template::_renderTemplate PHP Method

_renderTemplate() private method

Requires a template in the context of a function, with parameters extracted as php variables
See also: http://www.sitepoint.com/article/beyond-template-engine
private _renderTemplate ( $template, $vars )
    private function _renderTemplate($template, $vars)
    {
        extract($vars, EXTR_SKIP);
        ob_start();
        try {
            require $template;
            $contents = ob_get_contents();
        } catch (Exception $e) {
            // TODO: come up with a clever way of chaining exceptions
            ob_end_clean();
            throw $e;
        }
        ob_end_clean();
        return $contents;
    }