Any suggestions for how to access components in a directory such as, for example, wwwroot/ApplicationName/Model/Components
where I cannot have a mapping setup? Is there a way to do this with CFOBJECT (in a modified format from below), or do I need to resort to CFINVOKE? If so, what would the path callout look like using CFOBJECT or CFINVOKE?:
Looking for a modified line of the above code that works in a relative path manner-
<cfobject name="oContactData" component="ApplicationName.Model.Components.CFCmyprofile ">
<cfset qContacts = #oContactData.getMyContacts(SESSION.auth.SkillshowUserID, -1)#>
Looking for a modified line of the above code that works in a relative path manner-
Mark,
ReplyDeleteThis doesn't exactly handle "relative" paths, per-say, however, it can easily be set up to let Application handle the CFC creation. Take a look at this:
http://bennadel.com/index.cfm?dax=blog:348.view
It details exactly the issue you are trying to overcome. I hate mapped paths... down with paths!
That absolutely should work - unless your hosting provider is stupid enough to have created a mapping for "/" which breaks CFC lookup.
ReplyDeleteWho is your shared hosting provider?
Hi Ben, Sean,
ReplyDeleteThanks for the info, and the confirmation. I'm going to give that a spin tonight. I might have some questions later!
...it's too bad this isn't built into CFC's in a more robust manner. It would seem that MVC, and the ability to access CFC's via relative paths would be a main requirement (for ANT builds, etc). If I'm missing something, someone please alert me. Ben's path looks like a good one to go down.
Thanks and cheers-