| Contents > Developing ColdFusion MX Applications > Building and Using ColdFusion Components > Building ColdFusion components > Structuring and reusing code Using component packages |
|
|
|
|
||
Components stored in the same directory are members of a component package. Component packages help prevent naming conflicts and facilitate easy component deployment. For example:
access="package" attribute in a method's cffunction tag, access to the method is limited to components in the same package. Components in other packages cannot use this method, even if they specify it with a fully qualified component name. For more information on access security, see Using access security.<h3>Time Display Page</h3> <b>Server's Local Time:</b> <cfinvoke component="appResources.components.tellTime"
method="getLocalTime"><br> <b>Calculated UTC Time:</b> <cfinvoke component="appResources.components.tellTime"
method="getUTCTime">
You use dot syntax to navigate directory structures. Place the directory name before the component name.
The following example shows a CFScript invocation:
<cfscript>
helloCFC = createObject("component", "appResources.components.catQuery");
helloCFC.getSaleItems();
</cfscript>
The following example shows a URL invocation:
http://localhost/appResources/components/catQuery.cfc?method=getSalesItems
|
|
||
| Contents > Developing ColdFusion MX Applications > Building and Using ColdFusion Components > Building ColdFusion components > Structuring and reusing code Using component packages |
|
|
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/buildi53.htm