Skip to content

Instantly share code, notes, and snippets.

Created September 1, 2009 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/179272 to your computer and use it in GitHub Desktop.
Save anonymous/179272 to your computer and use it in GitHub Desktop.
<?php
/**
* sfValidatorUrl validates a url
*
* @author Brent Shaffer <bshafs@gmail.com>
*/
class sfValidatorUrl extends sfValidatorRegex
{
protected $_options = array('pattern' => "/http(s|):\/\/(.*)/");
protected $_messages = array('invalid' => 'Please Enter a Valid URL (starting with http)');
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