1. Go to this page and download the library: Download jbzoo/path library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Add virtual paths (extending existing aliases)
$path->add('css:vendor/bootstrap');
$path->add('css:vendor/fontawesome');
// Get all registered paths for an alias
$cssPaths = $path->getPaths('css:');
// Returns array of all CSS directories
// Check if file exists in any registered path
if ($path->get('css:custom.css')) {
echo '<link rel="stylesheet" href="' . $path->url('css:custom.css') . '">';
}
// Multiple file types under one alias
$path->add([
__DIR__ . '/public/images',
__DIR__ . '/uploads/images',
__DIR__ . '/cache/optimized'
], 'images');
// Will search in all image directories
$logoPath = $path->get('images:logo.png');
src/
├── Path.php # Main Path class
└── Exception.php # Custom exception class
tests/
├── PathTest.php # Main test suite
├── PathPhpStormProxyTest.php # IDE integration tests
├── PathPackageTest.php # Package validation tests
└── phpbench/ # Performance benchmarks
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.