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#”)>
<cfset componentPath=“com.somewhere.component”>
<cfset myObj=CreateObject(“component”,“#componentPath#”)>
Discover more from Adedeji Olowe
Subscribe to get the latest posts sent to your email.