aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/libs/plugins/modifiercompiler.strlen.php
blob: d43e8ef1c96bdec761b2f4c202bfe2d564a7915e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

/**
 * Smarty plugin
 *
 * @package    Smarty
 * @subpackage PluginsModifierCompiler
 */
/**
 * Smarty strlen modifier plugin
 * Type:     modifier
 * Name:     strlen
 * Purpose:  return the length of the given string
 *
 * @link   https://www.smarty.net/docs/en/language.modifier.strlen.tpl strlen (Smarty online manual)
  *
 * @param array $params parameters
 *
 * @return string with compiled code
 */
function smarty_modifiercompiler_strlen($params) {
    return 'strlen((string) ' . $params[0] . ')';
}