ProCacheTests::validateUrl() method

Validate a testing URL

Usage

// basic usage
$string = $tests->validateUrl(string $url);

// usage with all arguments
$string = $tests->validateUrl(string $url, array $options = []);

Arguments

NameType(s)Description
$urlstring

URL you want to validate

$options (optional)array

Options to modify behavior:

  • allowRelative (bool): Allow use of relative URLs? Default:false
  • requireScheme (bool): Require a scheme like 'https://' in the URL? Default:true
  • allowSchemes (array): Schemes that are allowed in URL Default:['http','https']

Return value

string

Returns URL on success or empty string if it did not validate


$tests methods and properties

API reference based on ProcessWire core version 3.0.252