snap-extras-0.1.7: A collection of useful helpers and utilities for Snap web applications.

Safe HaskellSafe-Infered




ifSplice :: Monad m => Bool -> Splice mSource

Run the splice contents if given condition is True, make splice disappear if not.

paramSplice :: MonadSnap m => Splice mSource

Gets the value of a request parameter. Example use:

rqparam name="username"/

utilSplices :: [(Text, SnapletSplice b v)]Source

A list of splices offered in this module

addUtilSplices :: HasHeist b => Initializer b v ()Source

Bind splices offered in this module in your Initializer



:: Monad m 
=> Text

A name for the select element

-> Text

An id for the select element

-> [(Text, Text)]

value, shown text pairs

-> Maybe Text

Default value

-> Splice m 

Splice helper for when you're rendering a select element

runTextAreas :: Monad m => HeistState m -> HeistState mSource

Assume text are contains the name of a splice as Text.

This is helpful when you pass a default value to digestive-functors by putting the name of a splice as the value of a textarea tag.

 heistLocal runTextAreas $ render "joo/index"