how to translate tags to CFScript
I want to use "pure" CFScript in my coding. there are many problems.
tags: <cfinclude to cfscript include
tags:
<cfswitch expression="#REQUEST.Attributes.Go[ 1 ]#">
<cfcase value="error">
<cfinclude template="./content/error/_index.cfm"/>
</cfcase>
<cfcase value="pickup">
<cfinclude template="./content/pickup/_index.cfm"/>
</cfcase>
<cfcase value="send">
<cfinclude template="./content/send/_index.cfm"/>
</cfcase>
<!--- Default to home. --->
<cfdefaultcase>
<cfinclude template="./content/home/_index.cfm"/>
</cfdefaultcase>
</cfswitch>
it works well
cfscripts:
<cffunction name="include">
<cfargument name="template">
<cfinclude template="#template#">
</cffunction>
<cfscript>
switch("#REQUEST.Attributes.Go[ 1 ]#")
{
case "error": include("./content/error/_index.cfm");
case "pickup": include("./content/pickup/_index.cfm");
case "send": include("./content/send/_index.cfm");
default: include("./content/home/_index.cfm");
}
not work well.
ps: code(tags) above is from Ben Nadel's eCards project.
anyone can help me ? thanks!