public function render($template, array $data = [])
    {
        $isString = is_string($template);

        if ($isString && is_file($template)) {
            return $this->renderTemplate($template, $data);
        }
        if (! $isString && ! is_array($template)) {
            throw new InvalidArgumentException('Template must be a string or an array of strings.');
        }
        $path = $this->find($template);
        if ($path) {
            return $this->doRender($path, $data);
        }
        if ($isString) {
            throw new RuntimeException($template.' is not a valid template name.');
        }

        throw new RuntimeException('Not found any valid template in the array provided.');
    }
public function render($template, array $data = [])
    {
        $isString = is_string($template);

        if ($isString && is_file($template)) {
            return $this->renderTemplate($template, $data);
        }
        if (! $isString && ! is_array($template)) {
            throw new InvalidArgumentException('Template must be a string or an array of strings.');
        }
        $path = $this->find($template);
        if ($path) {
            return $this->doRender($path, $data);
        }
        if ($isString) {
            throw new RuntimeException($template.' is not a valid template name.');
        }

        throw new RuntimeException('Not found any valid template in the array provided.');
    }
public function render ( $ template , array $ data = [ ] ) { $ isString = is_string ( $ template ) ; if ( $ isString && is_file ( $ template ) ) { return $ this -> renderTemplate ( $ template , $ data ) ; } if ( ! $ isString && ! is_array ( $ template ) ) { throw new InvalidArgumentException ( 'Template must be a string or an array of strings.' ) ; } $ path = $ this -> find ( $ template ) ; if ( $ path ) { return $ this -> doRender ( $ path , $ data ) ; } if ( $ isString ) { throw new RuntimeException ( $ template . ' is not a valid template name.' ) ; } throw new RuntimeException ( 'Not found any valid template in the array provided.' ) ; }
Render a given template with given data.

@param  string|array     $template
@param  array            $data
@return string
@throws RuntimeException
Render a given template with given data .