Closed ghost closed 6 years ago
Based on this thread in digestive-functors
, this functionality seems to be covered by NoEnvironment
constructor for Environment
, which allows you to use injected info from the form definition.
This could be more clearly documented.
If you look at a function like inputText
it allows you to provide the initial value,
http://hackage.haskell.org/package/reform-hsp-0.2.7.1/docs/Text-Reform-HSP-Text.html
So if you look at a function like this pageFormlet
you'll see it takes a Page
and returns the modified Page
,
https://github.com/clckwrks/clckwrks-plugin-page/blob/master/Clckwrks/Page/Admin/EditPage.hs#L52
If you peer through the ugliness you'll see that the initial form values are extracted from the page
value,
textarea 80 25 (markup (pageSrc page))
This is clearly something that should be shown more explicitly in this tutorial,
Reform nicely handles these use cases:
viewForm
eitherForm
However I haven't figured out how to achieve this use case:
Is there such a feature in Reform?