summaryrefslogtreecommitdiff
path: root/src/Renderer/Twig/Extensions/Config.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-08 12:48:08 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-09 12:11:12 +0200
commit222c9fed7d4ca2b3b44c05907fbb7080c1efd342 (patch)
tree62b1bfa9233000985331b9dea703d51dc24515a2 /src/Renderer/Twig/Extensions/Config.php
parent2d6bca1357faff28bc1f86a56b432cc463ff7574 (diff)
parent8257864829ffdfb410f05e0dd0a9c781f48b741a (diff)
Merge remote-tracking branch 'MyIgel/templating'
Diffstat (limited to 'src/Renderer/Twig/Extensions/Config.php')
-rw-r--r--src/Renderer/Twig/Extensions/Config.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Renderer/Twig/Extensions/Config.php b/src/Renderer/Twig/Extensions/Config.php
new file mode 100644
index 00000000..dbbe93e7
--- /dev/null
+++ b/src/Renderer/Twig/Extensions/Config.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace Engelsystem\Renderer\Twig\Extensions;
+
+use Engelsystem\Config\Config as EngelsystemConfig;
+use Twig_Extension as TwigExtension;
+use Twig_Function as TwigFunction;
+
+class Config extends TwigExtension
+{
+ /** @var EngelsystemConfig */
+ protected $config;
+
+ /**
+ * @param EngelsystemConfig $config
+ */
+ public function __construct(EngelsystemConfig $config)
+ {
+ $this->config = $config;
+ }
+
+ /**
+ * @return TwigFunction[]
+ */
+ public function getFunctions()
+ {
+ return [
+ new TwigFunction('config', [$this->config, 'get']),
+ ];
+ }
+}