Safe Haskell | None |
---|
Synopsis
- renderPlain :: (?context :: ControllerContext) => LByteString -> IO ()
- respondHtml :: (?context :: ControllerContext) => Html -> IO ()
- respondSvg :: (?context :: ControllerContext) => Html -> IO ()
- renderHtml :: (View view, ?context :: ControllerContext) => view -> IO Html
- renderFile :: (?context :: ControllerContext) => String -> ByteString -> IO ()
- renderJson :: (?context :: ControllerContext, ToJSON json) => json -> IO ()
- renderJsonWithStatusCode :: (?context :: ControllerContext, ToJSON json) => Status -> json -> IO ()
- renderXml :: (?context :: ControllerContext) => LByteString -> IO ()
- renderJson' :: (?context :: ControllerContext) => ResponseHeaders -> ToJSON json => json -> IO ()
- data PolymorphicRender = PolymorphicRender {}
- renderPolymorphic :: (?context :: ControllerContext) => PolymorphicRender -> IO ()
- polymorphicRender :: PolymorphicRender
- render :: (View view, ?context :: ControllerContext) => view -> IO ()
Documentation
renderPlain :: (?context :: ControllerContext) => LByteString -> IO () Source #
respondHtml :: (?context :: ControllerContext) => Html -> IO () Source #
respondSvg :: (?context :: ControllerContext) => Html -> IO () Source #
renderHtml :: (View view, ?context :: ControllerContext) => view -> IO Html Source #
renderFile :: (?context :: ControllerContext) => String -> ByteString -> IO () Source #
renderJson :: (?context :: ControllerContext, ToJSON json) => json -> IO () Source #
renderJsonWithStatusCode :: (?context :: ControllerContext, ToJSON json) => Status -> json -> IO () Source #
renderXml :: (?context :: ControllerContext) => LByteString -> IO () Source #
renderJson' :: (?context :: ControllerContext) => ResponseHeaders -> ToJSON json => json -> IO () Source #
Use setHeader
intead
data PolymorphicRender Source #
renderPolymorphic :: (?context :: ControllerContext) => PolymorphicRender -> IO () Source #
Can be used to render different responses for html, json, etc. requests based on Accept
header
Example:
show :: Action show = do renderPolymorphic polymorphicRender { html = renderHtml [hsx|<div>Hello World</div>|] json = renderJson True }
This will render Hello World
for normal browser requests and true
when requested via an ajax request