src/Sulu/Component/Util/SuluNodeHelper.php
public function extractSnippetTypeFromPath($path)
    {
        if ('/' !== substr($path, 0, 1)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Path must be absolute, got "%s"',
                    $path
                )
            );
        }

        $snippetsPath = $this->getBaseSnippetPath() . '/';
        $newPath = PathHelper::getParentPath($path);
        $newPath = substr($newPath, strlen($snippetsPath));

        if (false === $newPath) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Cannot extract snippet template type from path "%s"',
                    $path
                )
            );
        }

        return $newPath;
    }
public function extractSnippetTypeFromPath($path)
    {
        if ('/' !== substr($path, 0, 1)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Path must be absolute, got "%s"',
                    $path
                )
            );
        }

        $snippetsPath = $this->getBaseSnippetPath() . '/';
        $newPath = PathHelper::getParentPath($path);
        $newPath = substr($newPath, strlen($snippetsPath));

        if (false === $newPath) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Cannot extract snippet template type from path "%s"',
                    $path
                )
            );
        }

        return $newPath;
    }
public function extractSnippetTypeFromPath ( $ path ) { if ( '/' !== substr ( $ path , 0 , 1 ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Path must be absolute, got "%s"' , $ path ) ) ; } $ snippetsPath = $ this -> getBaseSnippetPath ( ) . '/' ; $ newPath = PathHelper :: getParentPath ( $ path ) ; $ newPath = substr ( $ newPath , strlen ( $ snippetsPath ) ) ; if ( false === $ newPath ) { throw new \ InvalidArgumentException ( sprintf ( 'Cannot extract snippet template type from path "%s"' , $ path ) ) ; } return $ newPath ; }
Extract the snippet path from the given path.

@param string $path

@return string

@throws \InvalidArgumentException
Extract the snippet path from the given path .