Skip to content

Commit e416e56

Browse files
committed
Uri path segmenter.
1 parent 51ab6cc commit e416e56

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils/UriHelper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,10 @@ public static function mapReplace(UriFactoryInterface $uriFactory, $uri, array $
157157
$uriStr = static::mapReplaceString($uri, $replaces, $encode_values);
158158
return $uriFactory->createUri($uriStr);
159159
}
160+
161+
public static function getSegments(UriInterface $uri) : array
162+
{
163+
$path = $uri->getPath();
164+
return explode('/', ltrim($path,'/'));
165+
}
160166
}

0 commit comments

Comments
 (0)