diff --git a/CHANGELOG.md b/CHANGELOG.md index 4feb2da40..bd7638d4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Added default setting to only allow `direct-installs` from official GPM. Can be configured in `system.yaml` * Added a new `Utils::isValidUrl()` method * Added optional parameter to `|markdown(false)` filter to toggle block/line processing (default|true = `block`) + * Added new `Page::folderExists()` method 1. [](#improved) * Genericized `direct-install` so it can be called via Admin plugin 1. [](#bugfix) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 010c906e1..d4bace32f 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -2560,6 +2560,16 @@ class Page return $file && $file->exists(); } + /** + * Returns whether or not the current folder exists + * + * @return bool + */ + public function folderExists() + { + return file_exists($this->path()); + } + /** * Cleans the path. *