Mecha CMS

To::URL()

Convert private file path into public URL, or decode URL special characters.

2.0.0Static

To::URL(string $in, $raw = false);

Example:

$A = To::URL('.\path\to\file.html');
$B = To::URL('foo%20bar+baz');
$C = To::URL('foo%20bar+baz', true);

Result:

$A = 'https://mecha-cms.com/path/to/file.html';
$B = 'foo bar baz';
$C = 'foo bar+baz';