Flow\Loader::resolvePath PHP Method

resolvePath() public method

public resolvePath ( $template, $from = '' )
    public function resolvePath($template, $from = '')
    {
        $source = implode('/', $this->normalizePath($this->options['source']));
        $parts = $this->normalizePath($source . '/' . dirname($from) . '/' . $template);
        foreach ($this->normalizePath($source) as $i => $part) {
            if ($part !== $parts[$i]) {
                throw new \RuntimeException(sprintf('%s is outside the source directory', $template));
            }
        }
        $path = trim(substr(implode('/', $parts), strlen($source)), '/');
        return $path;
    }