Posted a question to the stackoverflow ihp tag:
https://stackoverflow.com/questions/69740767/making-a-simple-form-type-safe
This one builds on the simple temperature conversion app I posted in my last question. The idea here is to have the form be generated in a type-safe manner, hopefully showing off IHP a little bit more. The type-safe form generation helpers are a nice feature of IHP and make it stand out amongst peer frameworks.
Any suggestions welcome there or here.
Thanks!
Glad you figured this one out :)
The id
can be removed in the future.
The meta
is currently used for storing the validation results. So this field is unlikely to go away.
It's working!
I've updated the question to show the updates I made to make the example function.
Notes
As mentioned there, it's a little awkward to have to add the unused
id
andmeta
fields inTemperature
just to satisfy the form generation code:Ideally we'd be able to leave those out.
Marc,
Is it conceivable that someday the form generation feature would be able to work without the
id
andmeta
fields? I.e. this way theTemperature
record would just be:If so, I'll be happy to open a github issue for this.
Or do you think that the presence of those fields is mandatory for the type-safe form generation feature?