Example #1
0
 /**
  * Short description of method __construct
  *
  * @access public
  * @author Cédric Alfonsi, <*****@*****.**>
  * @param  array options
  * @return mixed
  */
 public function __construct($options = array())
 {
     if (isset($options['format'])) {
         unset($options['format']);
         //the pattern cannot be overriden
     }
     $pattern = "/^[a-zA-Z0-9_\\-]*\\.[a-zA-Z0-9]*\$/";
     parent::__construct(array_merge(array('format' => $pattern), $options));
 }
Example #2
0
 /**
  * Short description of method __construct
  *
  * @access public
  * @author Bertrand Chevrier, <*****@*****.**>
  * @param  array options
  * @return mixed
  */
 public function __construct($options = array())
 {
     if (isset($options['format'])) {
         unset($options['format']);
         //the pattern cannot be overriden
     }
     $pattern = "([a-zA-Z]+:\\/\\/)?(www\\.)?([a-zA-Z0-9_\\-.\\/]){2,}(:[0-9]{1,5})?";
     if (isset($options['allow_parameters'])) {
         $pattern .= "(\\?(.*)+)?";
     }
     $pattern = "/^{$pattern}\$/";
     parent::__construct(array_merge(array('format' => $pattern), $options));
 }
Example #3
0
 /**
  * (non-PHPdoc)
  * @see tao_helpers_form_validators_Regex::setOptions()
  */
 public function setOptions(array $options)
 {
     $options['format'] = "/^[a-zA-Z0-9_\\-]*\\.[a-zA-Z0-9]*\$/";
     parent::setOptions($options);
 }
Example #4
0
 /**
  * (non-PHPdoc)
  * @see tao_helpers_form_validators_Regex::setOptions()
  */
 public function setOptions(array $options)
 {
     $options['format'] = isset($options['allow_punctuation']) ? "/^[a-zA-Z0-9_\\-]*\$/" : "/^[a-zA-Z0-9]*\$/";
     parent::setOptions($options);
 }