Add smarty modifer in_array

This commit is contained in:
markjcrane
2023-05-22 21:50:15 -06:00
parent 3311363c27
commit dbb3e90ace
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifier
*/
/**
* Smarty in_array modifier plugin
* Type: modifier
* Name: in_array
* Purpose: Checks if a value exists in an array
*
* @param string $needle
* @param array $haystack
*
* @return boolean
*/
function smarty_modifier_in_array($needle, $haystack)
{
return in_array($needle, $haystack);
}