Contao Utils Bundle

StaticUrlUtil extends AbstractStaticUtil
in package

Table of Contents

Methods

unparseUrl()  : string
This method is the reverse of {@see \parse_url `parse_url(...)`} and is used to build a URL from its components.

Methods

unparseUrl()

This method is the reverse of {@see \parse_url `parse_url(...)`} and is used to build a URL from its components.

public static unparseUrl(array{scheme?: string, host?: string, port?: int, user?: string, pass?: string, path?: string, query?: string, fragment?: string} $parsedUrl[, array{suffixEmptyScheme?: bool, prefixPath?: bool, prefixQuery?: bool, prefixFragment?: bool} $options = [] ]) : string

Options:

  • suffixEmptyScheme (bool): Whether to add // before the host if no scheme is provided. (default: true)
  • prefixPath (bool): Whether to add / before the path if the URL is otherwise empty. (default: true)
  • prefixQuery (bool): Whether to add ? before the query string if the URL is otherwise empty. (default: true)
  • prefixFragment (bool): Whether to add # before the fragment if the URL is otherwise empty. (default: true)
Parameters
$parsedUrl : array{scheme?: string, host?: string, port?: int, user?: string, pass?: string, path?: string, query?: string, fragment?: string}

The parsed URL components.

$options : array{suffixEmptyScheme?: bool, prefixPath?: bool, prefixQuery?: bool, prefixFragment?: bool} = []

Options for URL construction.

Tags
see
https://www.php.net/manual/en/function.parse-url.php
Return values
string

The reconstructed URL.


        
On this page

Search results