generateForm
This commit is contained in:
parent
07a5350e5b
commit
fd10f42db7
@ -19,6 +19,7 @@ module Yesod.Form
|
|||||||
, FormletField
|
, FormletField
|
||||||
, FormInput
|
, FormInput
|
||||||
-- * Unwrapping functions
|
-- * Unwrapping functions
|
||||||
|
, generateForm
|
||||||
, runFormGet
|
, runFormGet
|
||||||
, runFormMonadGet
|
, runFormMonadGet
|
||||||
, runFormPost
|
, runFormPost
|
||||||
@ -119,6 +120,12 @@ helper (FormSuccess a, _, _) = return a
|
|||||||
helper (FormFailure e, _, _) = invalidArgs e
|
helper (FormFailure e, _, _) = invalidArgs e
|
||||||
helper (FormMissing, _, _) = invalidArgs ["No input found"]
|
helper (FormMissing, _, _) = invalidArgs ["No input found"]
|
||||||
|
|
||||||
|
-- | Generate a form, feeding it no data.
|
||||||
|
generateForm :: GForm s m xml a -> GHandler s m (xml, Enctype)
|
||||||
|
generateForm f = do
|
||||||
|
(_, b, c) <- runFormGeneric [] [] f
|
||||||
|
return (b, c)
|
||||||
|
|
||||||
-- | Run a form against GET parameters.
|
-- | Run a form against GET parameters.
|
||||||
runFormGet :: GForm s m xml a -> GHandler s m (FormResult a, xml, Enctype)
|
runFormGet :: GForm s m xml a -> GHandler s m (FormResult a, xml, Enctype)
|
||||||
runFormGet f = do
|
runFormGet f = do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user