generateUrl()
Generates a URL for a specified page reference.
| Method Input | Type | Required/Optional | Description |
|---|---|---|---|
context | String | Required | The ID of the parent router container nearest to the component that's generating a URL. A ContextId is an opaque value that you get from the NavigationContext wire. |
pageReference | String | Required | The PageReference value for which to generate a URL. |
- If
pageReferenceis valid,generateUrl()returns a string with the generated URL for the specified route. - If
pageReferenceis invalid, it returnsnull. - If
contextis invalid,generateUrl()fails.
See Also