Builder
class Builder implements IBuilder (View source)
Responsible for building the URL of pages.
Properties
protected string | $path | Path component of the url (e.g. /path/to/page.html). | |
protected string | $anchor | The anchor component of the url (e.g. "shoes", if the url is "/view/category#shoes"). | |
protected string | $protocol | The used protocol of the url. | |
protected string | $host | The host of the url. | |
protected integer|null | $port | The port of the url. | |
protected array | $params | GET url parameters. |
Methods
__construct(array $components)
Constructor for the url builder.
string
build(array $params = array())
Builds the final url and merges saved params with given via parameter.
string
getPortForBuild()
Get the final port for build.
array
getParams()
Get params.
string
getPath()
Get path.
string
getAnchor()
Get anchor.
string
getHost()
Get host.
string
getProtocol()
Get used protocol.
integer
getPort()
Get used port.
array
unmaskUrl(string $url, array $params)
Unmasks a URL and replaces masks with a parameter value.
Expectation
shouldReceive(string $name)
No description
Details
at line 74
__construct(array $components)
Constructor for the url builder.
at line 99
string
build(array $params = array())
Builds the final url and merges saved params with given via parameter.
at line 122
protected string
getPortForBuild()
Get the final port for build.
at line 142
array
getParams()
Get params.
at line 152
string
getPath()
Get path.
at line 162
string
getAnchor()
Get anchor.
at line 172
string
getHost()
Get host.
at line 182
string
getProtocol()
Get used protocol.
at line 192
integer
getPort()
Get used port.
at line 206
protected array
unmaskUrl(string $url, array $params)
Unmasks a URL and replaces masks with a parameter value.