Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Get Path of current page

Started by Muut Archive 10 years ago · 2 replies · 1088 views
10 years ago

I am currently writing my first plugin for Grav and was wondering, how to get the path to the .md file which is currently opened using php.

10 years ago

Got get to the actual file, you can use:

PHP
$page->filePath()

How you get page depends on which event you are in. You can look in other plugins for examples.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1361 9 years ago
Archive · by Muut Archive, 9 years ago
2 939 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2958 9 years ago
Archive · by Muut Archive, 9 years ago
3 1123 9 years ago