I am working with CFWheels and jquery mobile and am trying to pass some jquerymobile settings into a linkto call (mainly the data-icon attribute. I never new this before, but it appears to be that ColdFusion doesn't allow hyphens in argument names. My call is as follows:
<cfset contentFor(actioncontent=linkTo(text='Login', route='login', data-icon='check')) />
CFBuilder and Railo throw an error on the hyphen. The Railo error is:
invalid assignment left-hand side (railo.transformer.bytecode.op.OpDouble)
So my questions is: am I correct in saying that hyphens are not allowed in argument names? Also if they are not allowed, is there a way to get the hyphen through or do I just have to create the anchor tag?
try using quotes 'data-icon'
or doublequotes "data-icon"
It's being interpreted as a minus not a dash
You can get this to work on Railo and Adobe's CF by creating a struct first and sending it in the argument collection. Otherwise, it will only work on Railo.
Example:
<cfscript>
args = {controller="form",
'data-role'="button",
'data-theme'="c",
text="I Accept"};
</cfscript>
#linkTo(argumentCollection=args)#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With