https://github.com/germaniakg/pathprefixer
Recursively prepends a path prefix to path string, array or StdClass objects.
https://github.com/germaniakg/pathprefixer
array-manipulations prefix prepend stdclass-objects string-manipulation
Last synced: about 2 months ago
JSON representation
Recursively prepends a path prefix to path string, array or StdClass objects.
- Host: GitHub
- URL: https://github.com/germaniakg/pathprefixer
- Owner: GermaniaKG
- License: other
- Created: 2017-01-10T09:16:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-05-30T14:33:40.000Z (about 3 years ago)
- Last Synced: 2025-02-08T20:12:44.346Z (4 months ago)
- Topics: array-manipulations, prefix, prepend, stdclass-objects, string-manipulation
- Language: PHP
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Germania KG · PathPrefixer
**Recursively prepends a path prefix to path string, array or StdClass objects.**
[](https://packagist.org/packages/germania-kg/pathprefixer)
[](https://packagist.org/packages/germania-kg/pathprefixer)
[](https://travis-ci.org/GermaniaKG/PathPrefixer)
[](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/?branch=master)
[](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/?branch=master)
[](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/build-status/master)## Installation with Composer
```bash
$ composer require germania-kg/pathprefixer
```## Usage
```php
'includes',
'bar' => 'templates'
]);
// Result:
// 'foo' => '/path/to/root/includes',
// 'bar' => '/path/to/root/templates'
```### Custom path separators
Per default, the `DIRECTORY_SEPARATOR` constant will be used for glueing the prefix and the path.
You may pass a custom seperator as well:```php