cfdocs
cfdocs copied to clipboard
cfargument now accepts type=integer
As of CF2016+ apparently https://trycf.com/gist/dcf63d355df1063831bd485ed0453d8e/acf2016
need to see what other types might be added and confirm when it was added.
Looks like float
can also be used as an argument type.
And email
telephone
url
ssn
social_security_number
also work.
Possibly all the cfparam types work except for regex
which throws a java.lang.IllegalStateException
(because it needs the pattern). I tried
<cfargument name="foo" type="regex" pattern="[0-9]{3}">
But still get a IllegalStateException.
Interesting. Adding new types, especially undocumented, seems like it could break backward compatibility in some cases. I'm guessing these would take precedence over components of the same name, though I haven't tested that.
Yeah, good point - I haven't tested that yet either, not sure which takes precedence.
Also want to add to the ticket that this only works for cfargument types, does not work for returntype.
FYI - a ticket has been added to lucee: https://luceeserver.atlassian.net/browse/LDEV-2471
Two years on, this feature is still not documented. Is it considered safe and supported for use in CF applications?
Is there any move on Adobe's part to expand support for integer types beyond this limited use? For example, in typed arrays?
I see there's a ticket for Lucee, but I would recommend opening a ticket with Adobe to have these documented.
As for whether they add them to typed arrays, that should be another ticket.
@KamasamaK I agree. Hey @mark-demoss can you create ticket(s) and post the link back here.
Will do.
I also have an open support case and will let you know what I hear back.
https://tracker.adobe.com/#/view/CF-4212587
Adobe has updated their documentation:
https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-a-b/cfargument.html