Now click on the cfoInvokeMethod button in your cfObjects toolbar and you will see...
With the latest releases of cfObjects, many of the properties you see here are not needed. Just go to the Method
field and enter in aPage.buildPageHeader. When you create an object, cfObjects automatically
creates a ColdFusion structure with the format 'a' + {name of the class}, so in our case, the class was
page and the object aPage is created.
With this call, we're telling cfObjects to execute the buildPageHeader method code (contained
in the buildPageHeader.cfm file) for the Page class.
Remember the checkbox and Path To Class Dir for those of you with Shared Server deployments. Click OK to create the
following code
Internal Host Deployment
<cf_cfoInvokeMethod method="aPage.buildPageHeader">
Shared Server
Deployment
<cfmodule template="classes/cfoInvokeMethod.cfm" method="aPage.buildPageHeader">
Now repeat this process to call the other page methods - buildNavigation, defineMainContent, and buildFooter.
When completed, this is what you code should look like.
index.cfm
<cf_cfoCreateObject class="page" title="Home Page">
<cf_cfoInvokeMethod method="aPage.buildPageHeader">
<cf_cfoInvokeMethod method="aPage.buildNavigation">
<cf_cfoInvokeMethod method="aPage.defineMainContent">
<cf_cfoInvokeMethod method="aPage.buildFooter">
Once you've invoked all of page's method, save your file and then view it in a browser.
Congratulations! You've just built your first cfObjects page.
Move to Step 11 -->
|