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#”)>

Author: Adedeji Olowe

Adedeji / a bunch of bananas ate a monkey /

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.