示例#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));
 }
示例#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));
 }