Skip to content

Commit

Permalink
IHF: relative_path helper readme added.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ivanov committed Mar 15, 2017
1 parent 274e255 commit 965b1e7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Provides Laravel-specific and pure PHP helper functions.
- [to_rfc2822_email](#to_rfc2822_email)
- [to_swiftmailer_emails](#to_swiftmailer_emails)
- [Filesystem](#filesystem)
- [relative_path](#relative_path)
- [Format](#format)
- [get_dump](#get_dump)
- [format_bytes](#format_bytes)
Expand Down Expand Up @@ -276,6 +279,26 @@ $address = to_swiftmailer_emails(['address' => 'john.doe@example.com', 'name' =>
// ["john.doe@example.com" => "John Doe"]
```

## Filesystem

#### `relative_path()`

Returns the relative path of a directory given another one:

```php
$path = relative_path('/var/www/htdocs', '/var/www/htdocs/example')
// '../'
```

You can pass relative paths as a parameters:

```php
$path = relative_path('/var/www/htdocs/example/public/../../', '/var/')
// 'www/htdocs/'
```

## Format

#### `get_dump()`
Expand Down
2 changes: 1 addition & 1 deletion tests/HelperFunctions/filesystem/RelativePathTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Illuminated\Helpers\HelperFunctions\Tests\FileSystem;
namespace Illuminated\Helpers\HelperFunctions\Tests\Filesystem;

use Illuminated\Helpers\HelperFunctions\Tests\TestCase;

Expand Down

0 comments on commit 965b1e7

Please sign in to comment.