summaryrefslogtreecommitdiffstats
path: root/plugins/modifier.key_not_exists.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/modifier.key_not_exists.php')
-rw-r--r--plugins/modifier.key_not_exists.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/modifier.key_not_exists.php b/plugins/modifier.key_not_exists.php
new file mode 100644
index 0000000..f6906cd
--- /dev/null
+++ b/plugins/modifier.key_not_exists.php
@@ -0,0 +1,11 @@
+<?php
+
+function smarty_modifier_key_not_exists($value, $key)
+{
+ return array_filter($value,
+ function($v) use ($key) {
+ return !array_key_exists($key, $v);
+ });
+}
+
+?>