/framework/vendor/smarty2/plugins/function.constraint.php
PHP | 13 lines | 11 code | 2 blank | 0 comment | 0 complexity | 998a8ad58230986faf34b6152449c33f MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
- <?php
- function smarty_function_constraint($params, &$smarty)
- {
- $type = $params['type'];
- $name = $params['name'];
- $value = $params['value'];
- $inline = $params['inline'];
-
- $types = array('minlen' => 'minlen', 'sameas' => 'sameas');
- $type = $types[$type];
-
- return '<constraint type="' . $type . '" name="' . $name . '" value="' . $value . '" inline="' . $inline . '" />';
- }