Skip to content

Instantly share code, notes, and snippets.

@deltaforce
Created April 7, 2014 23:20
Show Gist options
  • Save deltaforce/10072758 to your computer and use it in GitHub Desktop.
Save deltaforce/10072758 to your computer and use it in GitHub Desktop.
railo implicit notation
according to the following url
http://www.getrailo.org/index.cfm/whats-up/railo-40-released/features/implicit-constructors/
<cfset foo = new foo(username:"user",password:"pass")>
should work, but doesn't seem to.
also the required attribute doesn't seem to work either, although this may be ACF only.
foo.cfc
-----------
COMPONENT {
accessors = true;
property string username setter = true required=true;
property string password setter = true required=true;
property string WSURL setter=true required=true;
public function init () {
return this;
}
}
test.cfm
---------
this works
<cfset foo = new foo()>
<cfset foo.username = "user">
<cfset wsp.password = "pass">
<cfdump var="#foo#">
test2.cfm
---------
This doesn't work, but is suppsoed to according to the docs I found.
<cfset foo = new foo(username:"user",password:"pass")>
<cfdump var="#foo#">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment