Skip to content

Commit

Permalink
added a relativePath() method
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed May 25, 2017
1 parent 4107518 commit 0ca5812
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions system/src/Grav/Common/Page/Medium/Medium.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,21 @@ public function path($reset = true)
return $this->get('filepath');
}

/**
* Return the relative path to file
*
* @param bool $reset
* @return mixed
*/
public function relativePath($reset = true)
{
if ($reset) {
$this->reset();
}

return str_replace(GRAV_ROOT, '', $this->get('filepath'));
}

/**
* Return URL to file.
*
Expand Down

0 comments on commit 0ca5812

Please sign in to comment.