From a2acb99c79735eab07c40eb779a7ad2b75e43e20 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 26 Apr 2016 13:00:17 -0600 Subject: [PATCH] Added new `Plugin::getBlueprint()` and `Theme::getBlueprint()` method --- CHANGELOG.md | 2 ++ system/src/Grav/Common/Plugin.php | 13 +++++++++++++ system/src/Grav/Common/Theme.php | 13 +++++++++++++ 3 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a47f7d6b..fe44e2aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # v1.1.0-beta.2 ## xx/xx/2016 +1. [](#new) + * Added new `Plugin::getBlueprint()` and `Theme::getBlueprint()` method 1. [](#improved) * Moved to new `data-*@` format in blueprints 1. [](#bugfix) diff --git a/system/src/Grav/Common/Plugin.php b/system/src/Grav/Common/Plugin.php index 99c7411a0..b5f432b87 100644 --- a/system/src/Grav/Common/Plugin.php +++ b/system/src/Grav/Common/Plugin.php @@ -294,6 +294,19 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess return true; } + /** + * Simpler getter for the plugin blueprint + * + * @return mixed + */ + public function getBlueprint() + { + if (!$this->blueprint) { + $this->loadBlueprint(); + } + return $this->blueprint; + } + /** * Load blueprints. */ diff --git a/system/src/Grav/Common/Theme.php b/system/src/Grav/Common/Theme.php index 783e26219..be34b287b 100644 --- a/system/src/Grav/Common/Theme.php +++ b/system/src/Grav/Common/Theme.php @@ -56,6 +56,19 @@ class Theme extends Plugin return true; } + /** + * Simpler getter for the theme blueprint + * + * @return mixed + */ + public function getBlueprint() + { + if (!$this->blueprint) { + $this->loadBlueprint(); + } + return $this->blueprint; + } + /** * Load blueprints. */