src/Sulu/Component/DocumentManager/PathBuilder.php
public function build(array $segments)
    {
        $results = [];
        foreach ($segments as $segment) {
            $result = $this->buildSegment($segment);

            if (null === $result) {
                continue;
            }

            $results[] = $result;
        }

        return '/' . implode('/', $results);
    }
public function build(array $segments)
    {
        $results = [];
        foreach ($segments as $segment) {
            $result = $this->buildSegment($segment);

            if (null === $result) {
                continue;
            }

            $results[] = $result;
        }

        return '/' . implode('/', $results);
    }
public function build ( array $ segments ) { $ results = [ ] ; foreach ( $ segments as $ segment ) { $ result = $ this -> buildSegment ( $ segment ) ; if ( null === $ result ) { continue ; } $ results [ ] = $ result ; } return '/' . implode ( '/' , $ results ) ; }
Build a path from an array of path segments.

Segments demarcated by "%" characters will be interpreted as path
segment *names* and their value will be resolved from the PathSegmentRegistry.

Other segments will be interpreted literally.

The following:

````
$path = $pathBuilder->build(array('%base%', 'hello', '%articles%'));
````

Will yield `/cms/hello/articleDirectory` where `%base%` is "cms" and
`%articles` is "articleDirectory"

@see Sulu\Component\DocumentManager\PathSegmentRegistry

@param array $segments

@return string
Build a path from an array of path segments .