Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

How do I get the filepath to the current page in my custom plugin

Started by Muut Archive 10 years ago · 3 replies · 744 views
10 years ago

I'm creating a plugin that stores a custom file in a subdirectory of the page being edited when the page is saved. To do this I'm adding a custom form processing action, and in the action the plugin will create a subdirectory. I need to know how to get the file system path to the current page.

10 years ago

Actually it's just:

PHP
$page->filePath()

See the API or view the code.

9 years ago

Not sure how I missed that in the API docs. Thanks.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Muut Archive, 10 years ago
1 672 1 week ago
Archive · by Deleted User, 9 years ago
0 3042 9 years ago
Archive · by Muut Archive, 9 years ago
2 1983 9 years ago
Archive · by Muut Archive, 9 years ago
2 5336 9 years ago
Archive · by Muut Archive, 9 years ago
1 4134 9 years ago