ihp-1.4.0: Haskell Web Framework
Copyright(c) digitally induced GmbH 2020
Safe HaskellNone
LanguageGHC2021

IHP.Router.UrlGenerator

Description

Provides the HasPath type class used for generating URL paths from controller actions. This is a lightweight module with minimal dependencies, allowing modules that only need path generation to avoid importing the full routing infrastructure.

Synopsis

Documentation

class HasPath controller where Source #

Type class for types that can be converted to URL paths.

This is used by IHP's routing system to generate URLs for controller actions.

Example:

>>> pathTo UsersAction
"/Users"
>>> pathTo ShowUserAction { userId = "a32913dd-ef80-4f3e-9a91-7879e17b2ece" }
"/ShowUser?userId=a32913dd-ef80-4f3e-9a91-7879e17b2ece"

Methods

pathTo :: controller -> Text Source #

Instances

Instances details
(Show controller, AutoRoute controller) => HasPath controller Source # 
Instance details

Defined in IHP.RouterSupport

Methods

pathTo :: controller -> Text Source #