I dont seem to be able to understand how to get the form data with heist.
I just started looking into Haskell web frameworks but documentation is a bit … scarce, to say the least. There is no mention of forms in the skinny heist tutorial on the snap website.
So given a simple html form, how do I get the form data for processing into my handler function? Can anyone point me to a tutorial, google just keeps quiet on this one? Or maybe a short example …
Also, where do I get information on the conditional control? Say, if I want conditionally include certain parts of the html within my page, how do I do it with heist? Basically, where is the “if”?
Thanks
See Using digestive functors with Heist for a good tutorial on simple forms, and mightybyte’s musings about heist. If you’re planning on using
multipart/form-datause theSnap.Util.FileUploadsmodule.You could use a
Spliceto generate content based on a condition.A
Splicereturns a list ofNode‘s,You would then bind this splice to a tag using something like:
bindSplice myTag mysplice defaultHeistStateAnd place
<myTag/>in your template. WhenHeistrenders the template, it will evaluate the splice when it encounters the tag and insert the value in its place.