Form data to typed classes

13 days ago

dkorpar
Member | 77
+
0
-

Are there any build in way of mapping form values to some kind of a typed entity, where we can force variable types?
Maybe some integration with https://github.com/nette/schema, would be specially interesting with php 7.4 and typed properties…

12 days ago

Mabar
Member | 177
+
+1
-

$form->setMappedType(TypedEntity::class), internally calls new TypedEntity and assigns values to public properties. Don't know about anything better and open-sourced yet.

12 days ago

dkorpar
Member | 77
+
0
-

@Mabar thanks I know I saw that somewhere, now was checking docs but can't find anything about it… @DavidGrudl maybe updating docs with this?

12 days ago

CZechBoY
Member | 3430
+
0
-

anybody can update it via pr https://github.com/nette/docs

12 days ago

dkorpar
Member | 77
+
+2
-

@CZechBoY if only we would know if it exists… Maybe best thing would be that person who adds some feature is required to put it to docs… PR wouldn't be merged until PR is made for docs and when merged both is merged feature and docs?