MACROMEDIA COLDFUSION MX 61-CFML Technické informace Strana 64

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 152
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 63
64 Chapter 6: Lesson 3: Retrieving Data
To create the CFC file:
1.
Create a directory named components as a subdirectory of the my_app directory.
2.
Open a new blank file.
Note: If you are using Dreamweaver, select Dynamic page in the Category list, and select
ColdFusion Component in the Dynamic Page list.
3.
Enter the following code, or do the steps listed in the “Let Dreamweaver do it section.
<cfcomponent displayName="Get Trips" hint="Get trip information">
<cffunction name="basicList" displayName="List all trips"
hint="List trips in same order as in table" access="public"
returnType="query" output="false">
<cfreturn>
</cffunction>
</cfcomponent>
4.
Save the file as gettrips.cfc in the components directory.
Let Dreamweaver do it
Dreamweaver lets you create a ColdFusion component without having to enter the code.
To create a CFC in Dreamweaver:
1.
Click the Components tab.
2.
Click the + button.
3.
In the Display name text box, enter Get Trips.
4.
In the Hint text box, enter Get trip information.
5.
In the Name text box, enter gettrips.
6.
Click the Browse button, and make the components directory the current directory.
7.
In the Section list, click Functions.
8.
Click the + button.
9.
In the Name text box, enter basicList.
10.
In the Display name text box, enter List all trips.
11.
In the Hint text box, enter List trips in same order as in the table.
12.
Select query as the Return type.
13.
Click OK.
14.
Save the file as gettrips.cfc in the components directory.
Zobrazit stránku 63
1 2 ... 59 60 61 62 63 64 65 66 67 68 69 ... 151 152

Komentáře k této Příručce

Žádné komentáře