Fixed issue with admin page using default expires, now forces 0 #1009

This commit is contained in:
Andy Miller
2017-03-08 15:36:28 -07:00
parent ba229a318a
commit 8a84626935
2 changed files with 6 additions and 0 deletions

View File

@@ -390,11 +390,15 @@ class AdminPlugin extends Plugin
$this->grav['page'] = function () use ($self) {
$page = new Page;
$page->expires(0);
// If the page cannot be found in other plugins, try looking in admin plugin itself.
if (file_exists(__DIR__ . "/pages/admin/{$self->template}.md")) {
$page->init(new \SplFileInfo(__DIR__ . "/pages/admin/{$self->template}.md"));
$page->slug(basename($self->template));
return $page;
}