General functions for forms that are rendered to some sort of HTML
- data FormHtmlConfig = FormHtmlConfig {
- htmlInputClasses :: [String]
- htmlLabelClasses :: [String]
- htmlErrorClasses :: [String]
- htmlErrorListClasses :: [String]
- newtype FormHtml a = FormHtml {
- unFormHtml :: FormHtmlConfig -> a
- applyClasses :: (a -> String -> a) -> [FormHtmlConfig -> [String]] -> FormHtmlConfig -> a -> a
- defaultHtmlConfig :: FormHtmlConfig
- emptyHtmlConfig :: FormHtmlConfig
- renderFormHtml :: FormHtml a -> a
- renderFormHtmlWith :: FormHtmlConfig -> FormHtml a -> a
Documentation
data FormHtmlConfig Source
Settings for classes in generated HTML.
FormHtmlConfig | |
|
HTML describing a form
FormHtml | |
|
:: (a -> String -> a) | Apply the class attribute |
-> [FormHtmlConfig -> [String]] | Labels to apply |
-> FormHtmlConfig | Label configuration |
-> a | HTML element |
-> a | Resulting element |
Apply all classes to an HTML element. If no classes are found, nothing happens.
defaultHtmlConfig :: FormHtmlConfigSource
Default configuration
emptyHtmlConfig :: FormHtmlConfigSource
Empty configuration (no classes are set)
renderFormHtml :: FormHtml a -> aSource
Render FormHtml using the default configuration
renderFormHtmlWith :: FormHtmlConfig -> FormHtml a -> aSource
Render FormHtml using a custom configuration