function check($value) { $pattern = '#^' . '((?<protocol>https?|ftp)://)' . '(?<domain>[-A-Z0-9.]+)' . '(?<file>/[-A-Z0-9+&@\\#/%=~_|!:,.;]*)?' . '(?<parameters>\\?[-A-Z0-9+&@\\#/%=~_|!:,.;]*)?' . '$#i'; if (!preg_match($pattern, $value, $matches)) { return $this->error('{Field} is not an url.'); } parent::check($matches['domain']); }
protected function _checkDomain($value) { parent::check($value); }