/** * * Constructor * * @param string $type control type * @param array $args params for validate */ public function __construct($type, $args) { parent::__construct($type, $args); //we expect an item with key 'count' and an item with key 'mincount' in $args $this->count = isset($args['count']) ? $args['count'] : 0; $this->mincount = isset($args['mincount']) ? $args['mincount'] : 0; }
/** * * Constructor * * @param string $type control type * @param array $args params for validate */ public function __construct($type, $args) { parent::__construct($type, $args); //we expect an item with key 'value' and an item with key 'cvalue' in $args $this->value = isset($args['value']) ? $args['value'] : ''; $this->cvalue = isset($args['cvalue']) ? $args['cvalue'] : ''; }
/** * * Constructor * * @param string $type control type * @param array $args params for validate */ public function __construct($type, $args) { parent::__construct($type, $args); $this->regex = '/^(http|https|ftp)\\:\\/\\/[a-z0-9\\-\\.]+\\.[a-z]{2,3}(:[a-z0-9]*)?\\/?([a-z0-9\\-\\._\\?\\,\'\\/\\\\+&%\\$#\\=~])*$/i'; //we expect an item with key 'value' in $args $this->value = isset($args['value']) ? $args['value'] : ""; }
/** * * Constructor * * @param string $type control type * @param array $args params for validate */ public function __construct($type, $args) { parent::__construct($type, $args); $this->regex = '/^([a-zA-Z0-9_\\.\\-\\+%])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/'; //we expect an item with key 'value' in $args $this->value = isset($args['value']) ? $args['value'] : ""; }
/** * * Constructor * * @param string $type control type * @param array $args params for validate */ public function __construct($type, $args) { parent::__construct($type, $args); //we expect an item with key 'value' and an item with key 'regex' in $args $this->value = isset($args['value']) ? $args['value'] : ""; $this->regex = isset($args['regex']) ? $args['regex'] : ""; }
/** * * Constructor * * @param string $type control type * @param array $args params for validate */ public function __construct($type, $args) { parent::__construct($type, $args); $this->regex = '/^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)?(?:\\.\\d+)?$/'; $this->value = isset($args['value']) ? $args['value'] : 0; }