Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where does a CFC get it's Application Scope

I have a group of CFC's that I access from two seperate Applicaiton scopes.

One /Application.cfc is in the Root.

The other Application is in /Admin/Application.cfc The cfcs are in in /_cfc/

If I call a cfc (using createObject())from a page in (for example) /Admin/members/edit.cfm, does this cfc get it's Application scope from:

Application 1: /Application.cfc

or

Application 2: /Admin/Application.cfc

The calling page is under Application 2, but the CFC itself is under Application 1.

I hope I am making sense.

Thanks

Jason

like image 852
Jason Avatar asked Apr 02 '12 06:04

Jason


1 Answers

Scopes are dependant on the context in which a cfc is instantiated and not its physical location.

So given your example a cfc that lives under Application1 instantiated from a template in Application2 will see the application scope from Application2

like image 62
Chris Blackwell Avatar answered Sep 28 '22 01:09

Chris Blackwell