Dreamweaver CS4 Resources
|
Create or delete a CFC in Dreamweaver
You can use Dreamweaver to
visually define a CFC and its functions. Dreamweaver creates
a .cfc file and inserts the necessary CFML tags for you. Note: Depending
on the component, you may have to complete some code by hand.
- Open a ColdFusion page in Dreamweaver.
- In the Components panel (Window > Components),
select CF Components from the pop‑up menu.
- Click the Plus (+) button, and complete the Create Components
dialog box, and click OK.
- In the Components section, enter the details
about the component. Here is a partial list:
- Name
- Specifies the filename of the component. The name must contain
only alphanumeric characters and underscores (_). Don’t specify
the .cfc file extension when entering the name.
- Component Directory
- Specifies where the component is saved. Select the web application’s
root folder (such as \Inetpub\wwwroot\myapp\) or any of its subfolders.
- To define one or more functions for the component,
select Functions from the Section list, click the Plus (+) button,
and enter the details of the new function.
Ensure that you specify the type of the value returned
by the function in the Return Type option.
 If
you select remote from the Access menu, the function becomes available
as a web service.
- To define one or more arguments for a function, select
Arguments from the Section list, select the function from the pop‑up
menu, click the Plus (+) button, and enter the details of the new
argument on the right.
- If you use a remote development server, upload the CFC
file and any dependent files (such as those used to implement a
function or include files) to the remote server.
Uploading the files ensures that Dreamweaver features
such as Live Data view and Preview In Browser work properly.
Dreamweaver writes a CFC file and saves it
in the folder you specified. The new component also appears in the
Components panel (after clicking Refresh).
- To remove a component, you must delete the CFC file manually
from the server.
|