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

Discover more from Adédèjì Ọlọ́wẹ̀

Subscribe to get the latest posts to your email.

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.

Discover more from Adédèjì Ọlọ́wẹ̀

Subscribe now to keep reading and get access to the full archive.

Continue reading