src/Template/Renderer.php
public function render($template, array $data = array())
    {
        list($file, $name) = array(null, str_replace('.', '/', $template));

        foreach ((array) $this->paths as $key => $path) {
            $files = (array) $this->files($path);

            $item = $this->check($files, $path, $key, $name . '.php');

            $item !== null && $file = $item;
        }

        if (is_null($file) === true) {
            $message = 'Template file "' . $name . '" not found.';

            throw new \InvalidArgumentException((string) $message);
        }

        return $this->extract($file, $data);
    }
public function render($template, array $data = array())
    {
        list($file, $name) = array(null, str_replace('.', '/', $template));

        foreach ((array) $this->paths as $key => $path) {
            $files = (array) $this->files($path);

            $item = $this->check($files, $path, $key, $name . '.php');

            $item !== null && $file = $item;
        }

        if (is_null($file) === true) {
            $message = 'Template file "' . $name . '" not found.';

            throw new \InvalidArgumentException((string) $message);
        }

        return $this->extract($file, $data);
    }
Renders a file from a specified template.

@param  string $template
@param  array  $data
@return string

@throws \InvalidArgumentException