Returns a URL pointing to a combination of controller and action. Param
$url can be:
- Empty - the method will find address to actual controller/action.
- '/' - the method will find base URL of application.
- A combination of controller/action - the method will find URL for it.
There are a few 'special' parameters that can change the final URL string that is generated
- base - Set to false to remove the base path from the generated URL. If your application
is not in the root directory, this can be used to generate URLs that are 'cake relative'.
cake relative URLs are required when using requestAction.
- ? - Takes an array of query string parameters
- # - Allows you to set URL hash fragments.
- full_base - If true the Router::fullBaseUrl() value will be prepended to generated URLs.
public static url ( string | array $url = null, boolean | array $full = false ) : string | ||
$url | string | array | Cake-relative URL, like "/products/edit/92" or "/presidents/elect/4" or an array specifying any of the following: 'controller', 'action', and/or 'plugin', in addition to named arguments (keyed array elements), and standard URL arguments (indexed array elements) |
$full | boolean | array | If (bool) true, the full base URL will be prepended to the result. If an array accepts the following keys - escape - used when making URLs embedded in html escapes query string '&' - full - if true the full base URL will be prepended. |
return | string | Full translated URL with base path. |