From 99c361119122fe60961ff36ccecb8c245f04059f Mon Sep 17 00:00:00 2001 From: matthes Date: Wed, 28 Mar 2018 15:07:17 +0200 Subject: [PATCH] Added addPlugin() with TextTemplatePlugin --- src/TextTemplate.php | 5 +++++ src/TextTemplatePlugin.php | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/TextTemplatePlugin.php diff --git a/src/TextTemplate.php b/src/TextTemplate.php index 00a0796..1dc5b16 100644 --- a/src/TextTemplate.php +++ b/src/TextTemplate.php @@ -105,6 +105,11 @@ public function addFunction ($functionName, callable $callback) { return $this; } + public function addPlugin (TextTemplatePlugin $plugin) + { + $plugin->registerPlugin($this); + } + /** * Register all public Functions from an Object * diff --git a/src/TextTemplatePlugin.php b/src/TextTemplatePlugin.php new file mode 100644 index 0000000..7994c2a --- /dev/null +++ b/src/TextTemplatePlugin.php @@ -0,0 +1,15 @@ +