Skip to content

LoyaltyProductsListUrl

The LoyaltyProductsListUrl object extends the Url object. Represents a link to the list of loyalty products.

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

Methods

url.forPage(int page)

Method returns LoyaltyProductsListUrl object with the page parameter set in the url.

source
{{ url.forPage(10).relative }}
output
/pl/l/0/10

url.forView(string view)

Method returns LoyaltyProductsListUrl object with the view parameter set in the url.

source
{{ url.forView(view-name) }}
output
/pl/l/0/1/view-name

url.forSort(int sort)

Method returns LoyaltyProductsListUrl object with the sort parameter set in the url

source
{{ url.forSort(3).relative }}
output
/pl/l/0/1/default/3

Examples

Displaying absolute url with page parameter set:

source
{{ url.forPage(6).absolute }}
output
https://example.com/pl/l/0/6

Displaying absolute url with view parameter set:

source
{{ url.forView(view-example).absolute }}
output
https://example.com/pl/l/0/1/view-name

It is also possible to call these methods in chain and build an url with multiple parameters:

source
{{ url.forPage(2).forView(example-view).forSort(5).absolute }}
output
https://example.com/pl/l/0/2/example-view/5