Skip to content

ProductsOfTheDayUrl

The ProductsOfTheDayUrl object extends the Url object. Represents a link to the list of products of the day.

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

Methods

url.forPage(int page)

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

source
{{ url.forPage(3).relative }}
output
/pl/day/3

url.forView(string view)

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

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

url.forSort(int sort)

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

source
{{ url.forSort(4).relative }}
output
/pl/day/1/default/4

Examples

Displaying absolute url with page parameter set:

source
{{ url.forPage(3).absolute }}
output
https://domain.com/pl/day/3

Displaying absolute url with view parameter set:

source
{{ url.forView(view-example).absolute }}
output
https://domain.com/pl/day/1/view-example

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(12).absolute }}
output
https://domain.com/pl/day/2/example-view/12