From 680a6c8983fdde5ea00f478765ef6d1aecaa107c Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 2 Oct 2017 17:33:43 -0600 Subject: [PATCH] Added a new `http_status_code` Twig function --- CHANGELOG.md | 3 ++- system/src/Grav/Common/Twig/TwigExtension.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a32fba93..9397d59c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ # v1.3.5 -## 09/30/2017 +## xx/xx/2017 1. [](#improved) * Updated `bin/grav clean` command to remove unnecessary vendor files (save some bytes) + * Added a `http_status_code` Twig function to allow setting HTTP status codes from Twig directly. # v1.3.4 ## 09/29/2017 diff --git a/system/src/Grav/Common/Twig/TwigExtension.php b/system/src/Grav/Common/Twig/TwigExtension.php index e660db509..f008d5a5f 100644 --- a/system/src/Grav/Common/Twig/TwigExtension.php +++ b/system/src/Grav/Common/Twig/TwigExtension.php @@ -122,6 +122,7 @@ class TwigExtension extends \Twig_Extension new \Twig_SimpleFunction('dump', [$this, 'dump'], ['needs_context' => true, 'needs_environment' => true]), new \Twig_SimpleFunction('vardump', [$this, 'vardumpFunc']), new \Twig_SimpleFunction('print_r', 'print_r'), + new \Twig_SimpleFunction('http_response_code', 'http_response_code'), new \Twig_SimpleFunction('evaluate', [$this, 'evaluateStringFunc'], ['needs_context' => true, 'needs_environment' => true]), new \Twig_SimpleFunction('evaluate_twig', [$this, 'evaluateTwigFunc'], ['needs_context' => true, 'needs_environment' => true]), new \Twig_SimpleFunction('gist', [$this, 'gistFunc']),