Created
September 19, 2011 19:28
-
-
Save imageaid/1227340 to your computer and use it in GitHub Desktop.
CFWheels $getPathFromRequest Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="$getPathFromRequest" returntype="string" access="public" output="false"> | |
<cfargument name="pathInfo" type="string" required="true"> | |
<cfargument name="scriptName" type="string" required="true"> | |
<cfscript> | |
var returnValue = ""; | |
// we want the path without the leading "/" so this is why we do some checking here | |
if (arguments.pathInfo == arguments.scriptName || arguments.pathInfo == "/" || arguments.pathInfo == "") | |
returnValue = ""; | |
else | |
returnValue = Right(arguments.pathInfo, Len(arguments.pathInfo)-1); | |
</cfscript> | |
<cfreturn returnValue> | |
</cffunction> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment