public function resolve($template)
    {
        $namespace = self::DEFAULT_NAMESPACE;
        if (preg_match('#^(?P<namespace>[^:]+)::(?P<template>.*)$#', $template, $matches)) {
            $namespace = $matches['namespace'];
            $template  = $matches['template'];
        }

        $segments = explode($this->getSeparator(), $template);
        $template = implode('/', $segments) . $this->getSuffix();

        $path = $this->fetchTemplateForNamespace($template, $namespace);

        if ($path !== false || $namespace === self::DEFAULT_NAMESPACE) {
            return $path;
        }

        return $this->fetchTemplateForNamespace($template, self::DEFAULT_NAMESPACE);
    }
public function resolve($template)
    {
        $namespace = self::DEFAULT_NAMESPACE;
        if (preg_match('#^(?P<namespace>[^:]+)::(?P<template>.*)$#', $template, $matches)) {
            $namespace = $matches['namespace'];
            $template  = $matches['template'];
        }

        $segments = explode($this->getSeparator(), $template);
        $template = implode('/', $segments) . $this->getSuffix();

        $path = $this->fetchTemplateForNamespace($template, $namespace);

        if ($path !== false || $namespace === self::DEFAULT_NAMESPACE) {
            return $path;
        }

        return $this->fetchTemplateForNamespace($template, self::DEFAULT_NAMESPACE);
    }
public function resolve ( $ template ) { $ namespace = self :: DEFAULT_NAMESPACE ; if ( preg_match ( '#^(?P<namespace>[^:]+)::(?P<template>.*)$#' , $ template , $ matches ) ) { $ namespace = $ matches [ 'namespace' ] ; $ template = $ matches [ 'template' ] ; } $ segments = explode ( $ this -> getSeparator ( ) , $ template ) ; $ template = implode ( '/' , $ segments ) . $ this -> getSuffix ( ) ; $ path = $ this -> fetchTemplateForNamespace ( $ template , $ namespace ) ; if ( $ path !== false || $ namespace === self :: DEFAULT_NAMESPACE ) { return $ path ; } return $ this -> fetchTemplateForNamespace ( $ template , self :: DEFAULT_NAMESPACE ) ; }
Resolve a template to its file

@param  string $template
@return false|string Returns false if unable to resolve the template to a path
Resolve a template to its file