public function applyNamespaceToPath($path)
    {
        /** @var ViewFinderInterface $finder */
        $finder = $this->getContainer()['view.finder'];
        if (!method_exists($finder, 'getHints')) {
            return $path;
        }
        $delimiter = $finder::HINT_PATH_DELIMITER;
        $hints = $finder->getHints();
        $view = array_reduce(array_keys($hints), function ($view, $namespace) use ($delimiter, $hints) {
            return str_replace($hints[$namespace], $namespace.$delimiter, $view);
        }, $path);
        return preg_replace("%{$delimiter}[\\/]*%", $delimiter, $view);
    }
public function applyNamespaceToPath($path)
    {
        /** @var ViewFinderInterface $finder */
        $finder = $this->getContainer()['view.finder'];
        if (!method_exists($finder, 'getHints')) {
            return $path;
        }
        $delimiter = $finder::HINT_PATH_DELIMITER;
        $hints = $finder->getHints();
        $view = array_reduce(array_keys($hints), function ($view, $namespace) use ($delimiter, $hints) {
            return str_replace($hints[$namespace], $namespace.$delimiter, $view);
        }, $path);
        return preg_replace("%{$delimiter}[\\/]*%", $delimiter, $view);
    }
public function applyNamespaceToPath ( $ path ) { /** @var ViewFinderInterface $finder */ $ finder = $ this -> getContainer ( ) [ 'view.finder' ] ; if ( ! method_exists ( $ finder , 'getHints' ) ) { return $ path ; } $ delimiter = $ finder :: HINT_PATH_DELIMITER ; $ hints = $ finder -> getHints ( ) ; $ view = array_reduce ( array_keys ( $ hints ) , function ( $ view , $ namespace ) use ( $ delimiter , $ hints ) { return str_replace ( $ hints [ $ namespace ] , $ namespace . $ delimiter , $ view ) ; } , $ path ) ; return preg_replace ( "%{$delimiter}[\\/]*%" , $ delimiter , $ view ) ; }
Convert path to view namespace

@param string $path
@return string
Convert path to view namespace