yesod-alerts-0.1.0.0: Alert messages for the Yesod framework

Safe HaskellNone
LanguageHaskell2010

Yesod.Alert

Contents

Description

Setup this package by modifying your definition of *defaultLayout* in *Foundation.hs*

     ...
     defaultLayout widget = do
     ...
     alerts  <- getAlerts
     ...

Then Include a renderer in *default-layout.hamlet*

     ...
     #{renderAlertsBootstrap3 alerts}
     ...
     ^{widget}
     ...

Set alerts from your handlers

     getHomeR :: Handler Html
     getHomeR = do
         ...
         setAlert (Alert Error "oops")
         setSuccessAlert "Yay!"
         ...
         defautlLayout $ do
             $(widgetFile "homepage")

Synopsis

Setting alerts

Shortcuts

Getting alerts

data Alert :: * #

Constructors

Alert