Skip to content

Instantly share code, notes, and snippets.

@boughtonp
Created February 22, 2012 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boughtonp/b53044f37f069effaa21 to your computer and use it in GitHub Desktop.
Save boughtonp/b53044f37f069effaa21 to your computer and use it in GitHub Desktop.
Example of using namespaced attributes with fusebox lexicon.
<circuit xmnls:label="lexicons/label" label:name="Fruit and Stuff">
<fuseaction name="apples" label:name="Yummy Apples">
<label:PageTitle contentvariable="PageTitle" />
</fuseaction>
</circuits>
<cfscript>
if (fb_.verbInfo.executionMode EQ "end")
{
CircuitAttr = myFusebox.getApplication()
.circuits[ListFirst(attributes.fuseaction)]
.getCustomAttributes('label')
;
FuseAttr = myFusebox.getApplication()
.circuits[ListFirst(attributes.fuseaction)]
.fuseactions[ListRest(attributes.fuseaction)]
.getCustomAttributes('label')
;
if ( StructKeyExists( CircuitAttr , 'name' ) )
{
fb_appendLine('<p>Section:#CircuitAttr.name#</p>');
}
else
{
fb_appendLine('<p>Section:#ListFirst(attributes.fuseaction)#</p>');
}
if ( StructKeyExists( FuseAttr , 'name' ) )
{
fb_appendLine('<p>Item:#FuseAttr .name#</p>');
}
else
{
fb_appendLine('<p>Item:#ListRest(attributes.fuseaction)#</p>');
}
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment