Getting Started
Setting Up
Creating Objects
Methods
Making the page
Invoking Methods
Using Events

Tag Reference

Object Reference

Download

Mailing List

Other Links


Let's start with a simple class that will build your application's UI - the Page class.

  1. Create a subdirectory in your class library named page
  2. Create a file named class.cfm in that directory. This is the class definition file
  3. Place the following code in the class definition file

    <cfscript>
       stClassDef = structNew();
    </cfscript>


  4. Now create a file named constructor.cfm and save it to this directory as well. The constructor method is what will define all of your class' properties. For instance, each of our Web pages must have a title and a background color, so let's create some properties for those by putting this code in the file.

    <cfscript>
      self.title = "cfObjects Samples";
      self.bgcolor = "white";
    </cfscript>


    Here we defined that, by default, each page's title will be "cfObjects Samples" and the background color will be white.

We have now defined the class. This alone doesn't do much. We simply have a few properties for it. Now we need to make some methods for the class - code that actually does something.

Move to Step 8 -->











SourceForge.net Logo