add getPagePathsByPath method

This commit is contained in:
ghost 2024-02-02 11:51:59 +02:00
parent 30e55ac8d5
commit d5b1f09dbb
2 changed files with 22 additions and 0 deletions

View file

@ -136,6 +136,18 @@ var_dump (
) )
``` ```
#### Filesystem::getPagePathsByPath
Return pages under the given data directory
```
var_dump (
$filesystem->getPagePathsByPath(
// absolute path to target data directory (e.g. Filesystem::getDirectoryPathByUri)
)
)
```
#### Filesystem::getDirectoryPathByUri #### Filesystem::getDirectoryPathByUri
#### Filesystem::getPagePathByUri #### Filesystem::getPagePathByUri

View file

@ -32,6 +32,16 @@ class Filesystem
return $this->_list; return $this->_list;
} }
public function getPagePathsByPath(string $path): ?array
{
if (isset($this->_tree[$path]))
{
return $this->_tree[$path];
}
return null;
}
public function getPagePathByUri(string $uri): ?string public function getPagePathByUri(string $uri): ?string
{ {
$path = sprintf( $path = sprintf(