PHP code example of phpdot / path
1. Go to this page and download the library: Download phpdot/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/ */
phpdot / path example snippets
use PHPdot\Path\Contract\PathRegistryInterface;
$path = $container->get(PathRegistryInterface::class);
$path->base(); // /var/www/app
$path->config(); // /var/www/app/config
$path->vendor(); // /var/www/app/vendor
$path->public(); // /var/www/app/public
$path->protected(); // /var/www/app/protected
$path->get('uploads'); // /var/www/app/storage/uploads
$path->has('uploads'); // true