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.
Archive
Use $this->grav['page'] to have access to the current Page object
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.
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1362 | 9 years ago | ||
| 2 | 940 | 9 years ago | ||
| 2 | 4069 | 9 years ago | ||
| 1 | 2959 | 9 years ago | ||
| 3 | 1124 | 9 years ago |