public function render($template, array $viewData = [])
    {
        $filePath = $this->finder->getTemplatePath($template);
        if ($filePath == false) {
            throw new InvalidArgumentException("Can't load template '$template'");
        }
        ob_start();
        extract($viewData);
        include($filePath);
        $contents = ob_get_contents();
        ob_end_clean();
        return $contents;
    }
public function render($template, array $viewData = [])
    {
        $filePath = $this->finder->getTemplatePath($template);
        if ($filePath == false) {
            throw new InvalidArgumentException("Can't load template '$template'");
        }
        ob_start();
        extract($viewData);
        include($filePath);
        $contents = ob_get_contents();
        ob_end_clean();
        return $contents;
    }
public function render ( $ template , array $ viewData = [ ] ) { $ filePath = $ this -> finder -> getTemplatePath ( $ template ) ; if ( $ filePath == false ) { throw new InvalidArgumentException ( "Can't load template '$template'" ) ; } ob_start ( ) ; extract ( $ viewData ) ; include ( $ filePath ) ; $ contents = ob_get_contents ( ) ; ob_end_clean ( ) ; return $ contents ; }
Renders template and returns output.

@param string $template template name
@param array $viewData
@return string
Renders template and returns output .