private function getTemplatePath($template)
    {
        if (strpos($template, '@') === false && !empty($this->defaultNamespace)) {
            $template .= '@' . $this->defaultNamespace;
        }
        
        $map = $this->buildTemplatesMap();
        
        if (!array_key_exists($template, $map)) {
            throw new \RuntimeException("A template by the name '$template' does not exist. The following templates are available: " . join(', ', array_keys($map)));
        }
        return $map[$template];
    }
private function getTemplatePath($template)
    {
        if (strpos($template, '@') === false && !empty($this->defaultNamespace)) {
            $template .= '@' . $this->defaultNamespace;
        }
        
        $map = $this->buildTemplatesMap();
        
        if (!array_key_exists($template, $map)) {
            throw new \RuntimeException("A template by the name '$template' does not exist. The following templates are available: " . join(', ', array_keys($map)));
        }
        return $map[$template];
    }
Returns the path to a given template.

The template name can contain a namespace like "template@ns" in case there are templates with the same name.

@param string $template
@return string
@throws \RuntimeException