Open kevinresol opened 8 years ago
mcli (https://github.com/waneck/mcli) and mweb (https://github.com/waneck/mweb) have supports for this feature with decoder using also abstracts. you can see an example here https://github.com/francescoagati/mweb-subdspatch-test/blob/master/Main.hx#L44
Currently the controller supports
Bool
,Int
,Float
,String
,Date
and their arrays as route parameters. They are parsed from html string to haxe values internally inControllerMacros
. It would be nice if users can provide their own parsers.For example, currently
ControllerMacros
usesDate.fromString
to parse a date. But if custom parsers are allowed I can parse, for example,"now"
asDate.now()
Related: #48