-
-
Save cordoval/82a0f43a4c2dd1073b79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* sfValidatorZip validates a zip code. | |
* | |
* @author Brent Shaffer <bshafs@gmail.com> | |
*/ | |
class sfValidatorZip extends sfValidatorRegex | |
{ | |
protected $_options = array('pattern' => "/^(^\d{5}([\-]\d{4})?$)*$/"); | |
protected $_messages = array('invalid' => 'Please Enter a Valid Zip Code'); | |
public function __construct($options = array(), $messages = array()) | |
{ | |
return parent::__construct(array_merge($this->_options, $options), array_merge($this->_messages, $messages)); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment