Dynamic Component Path

I moved a CMS application from one server to the other (which was almost a good replica of the production server) and CF couldn’t find my components again. Since I don’t have a ready access to the webroot to store my components I had to look for a way to dynamically pass the component path to the CreateObject function.

It is actually very simple:<br/>
<cfset componentPath="com.somewhere.component">
<cfset myObj=CreateObject("component","#componentPath#")>

Post a Comment

Your email is never published nor shared. Required fields are marked *

%d bloggers like this: