Skip to content

MainPageUrl

The MainPageUrl object extended the Url object and represents an absolute or relative link to the main page.

classDiagram
  direction LR
  MainPageUrl <|-- Url
  class Url{
  }
  class MainPageUrl{
    array params
    MainPageUrl forPage(int page)
    MainPageUrl forView(string view)
  }

Methods

url.forPage(int page)

MainPageUrl by calling this method you set the page parameter to the url

source
{{ url.forPage(2) }}
output
/en/index/2

url.forView(string view)

MainPageUrl by calling this method you set the view parameter to the url

source
{{ url.forView(special) }}
output
/en/index/1/special

Examples

The forPage() and forView() methods return the object so you can call relative or absolute properties on it

source
{{ url.forPage(2).absolute }}
output
https://domain.com/en/index/2

You can also call those methods in chain and create the url as you like

source
{{ url.forPage(2).forView(special).relative }}
output
/en/index/2/special