@Url()

New in 2.0

Generate URLs

Network InformationSince 2.0.0

Parameters

NameTypeRequiredDefaultDescription
maxInteger50Max length, default 50
protocolStringhttpProtocol (http/https), default http
domainString127.0.0.1:8080Domain/IP, default 127.0.0.1:8080
allowQueryParamsBooleanfalseGenerate query parameters, default false

Usage

@Url()

Generate URL with default parameters

Example:
@Url()
Output:
http://127.0.0.1:8080/P1ZXOF9uI0/http://127.0.0.1:8080/Dcm
@Url(max)

Generate URL with specified domain

Example:
@Url(true)
Output:
http://www.xcan.org:8080/aacj/uics?acc=67&ubc7=8jFchttp://www.xcan.org:8080/aacj/uics?name=8jkc&gggbssiu=78hbss
@Url(max,protocol,domain,allowQueryParams)

Generate URL with query parameters

Example:
@Url(https,www.xcan.org,user|name,true)
Output:
https://www.xcan.org:8080/aacj/uics?user=67&name=8jFchttps://www.xcan.org:8080/aacj/uics?name=8jkc&user=78hbss
← Back to Function Reference