foundeo / cfdocs

Repository for the cfdocs.org site.
https://cfdocs.org/
Other
181 stars 344 forks source link

cfargument now accepts type=integer #1179

Open pfreitag opened 5 years ago

pfreitag commented 5 years ago

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.

pfreitag commented 5 years ago

Looks like float can also be used as an argument type.

pfreitag commented 5 years ago

And email

pfreitag commented 5 years ago

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.

KamasamaK commented 5 years ago

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.

pfreitag commented 5 years ago

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.

pfreitag commented 5 years ago

FYI - a ticket has been added to lucee: https://luceeserver.atlassian.net/browse/LDEV-2471

mark-demoss commented 2 years ago

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?

KamasamaK commented 2 years ago

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.

pfreitag commented 2 years ago

@KamasamaK I agree. Hey @mark-demoss can you create ticket(s) and post the link back here.

mark-demoss commented 2 years ago

Will do.

I also have an open support case and will let you know what I hear back.

mark-demoss commented 2 years ago

https://tracker.adobe.com/#/view/CF-4212587

mark-demoss commented 2 years ago

Adobe has updated their documentation:

https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-a-b/cfargument.html