> For the complete documentation index, see [llms.txt](https://docs.elentra.org/ejs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.elentra.org/ejs/1.3/guide/plugins/core-plugins/instance-methods/usdgeneratepath.md).

# $generatePath

## Introduction

`$generatePath(string routeName, Object params = {}) : string`

The **$generatePath** instance method makes it possible to [generate](/ejs/1.3/guide/routing/path-generation.md) the absolute path to any [route](/ejs/1.3/guide/routing/routes.md) using its name and [parameters](/ejs/1.3/guide/routing/routes.md#parameters).  Using this method ensures all links are automatically updated whenever a route is changed.

Alternatively, you may use a [view link](/ejs/1.3/guide/routing/view-links.md) within your component templates to generate routes declaratively.
