MACROMEDIA COLDFUSION 5-DEVELOPING Instrukcja Użytkownika Strona 47

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 47
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 46
ColdFusion MX 7 Getting Started Experience Tutorial Page 47 of 47
16. If you leave the returnvariable attribute named getArtworkRet, you need to change all of the ColdFusion
variables in the HTML code to reflect this change. Instead, it is easier to rename the returnvariable to artwork.
Modify the cfinvoke tag as the following code shows
<cfinvoke
component="CFIDE.gettingstarted.tutorial.art"
method="getArtwork"
returnvariable="artwork">
</cfinvoke>
17. Save and browse the index.cfm page to see that it runs as it did before, when the cfquery tag was in the page.
Figure 78. The final
index.cfm page using the
cfinvoke tag to grab the
information from the
database for display
When you stored the cfquery in the index.cfm page, it was only available to that page. If you wanted to reuse the query
for another page, you would have to create a separate cfquery for the second page. Now that you have created the
CFC, you can use it in other pages by simply using the cfinvoke tag.
Next Step
This tutorial has introduced you to ColdFusion. To further your exploration, review the sample applications and code
snippets available in the ColdFusion MX 7 Getting Started Experience
(http://localhost:8500/cfide/gettingstarted/experience/).
Przeglądanie stron 46
1 2 ... 42 43 44 45 46 47

Komentarze do niniejszej Instrukcji

Brak uwag