diff --git a/CHANGELOG.md b/CHANGELOG.md index 29de3baaf..df7b1b795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 1. [](#new) * Added `Flex Pages` to Grav core and removed Flex Objects plugin dependency * Added `Utils::simpleTemplate()` method for very simple variable templating + * Added `array_diff()` twig function 1. [](#improved) * Improved `Flex Users`: obey blueprints and allow Flex to be used in admin only * Improved `Flex` to support custom site template paths diff --git a/system/src/Grav/Common/Twig/TwigExtension.php b/system/src/Grav/Common/Twig/TwigExtension.php index dae938db9..4a093cf46 100644 --- a/system/src/Grav/Common/Twig/TwigExtension.php +++ b/system/src/Grav/Common/Twig/TwigExtension.php @@ -150,6 +150,7 @@ class TwigExtension extends AbstractExtension implements GlobalsInterface new TwigFunction('array_key_exists', 'array_key_exists'), new TwigFunction('array_unique', 'array_unique'), new TwigFunction('array_intersect', [$this, 'arrayIntersectFunc']), + new TwigFunction('array_diff', 'array_diff'), new TwigFunction('authorize', [$this, 'authorize']), new TwigFunction('debug', [$this, 'dump'], ['needs_context' => true, 'needs_environment' => true]), new TwigFunction('dump', [$this, 'dump'], ['needs_context' => true, 'needs_environment' => true]),