/framework/vendor/smarty2/plugins/function.constraint.php

http://zoop.googlecode.com/ · PHP · 13 lines · 11 code · 2 blank · 0 comment · 0 complexity · 998a8ad58230986faf34b6152449c33f MD5 · raw file

  1. <?php
  2. function smarty_function_constraint($params, &$smarty)
  3. {
  4. $type = $params['type'];
  5. $name = $params['name'];
  6. $value = $params['value'];
  7. $inline = $params['inline'];
  8. $types = array('minlen' => 'minlen', 'sameas' => 'sameas');
  9. $type = $types[$type];
  10. return '<constraint type="' . $type . '" name="' . $name . '" value="' . $value . '" inline="' . $inline . '" />';
  11. }