The directory tree
We will create a tree from the examples
directory. In trees, we have "leaf nodes". The leaf nodes don't have any leaves or items after them. They are placed at the end of the path. In this case, the files will be our leaf items. Let's look at the markup page code. Here the tag sends the same information to the CFC. This time, we will use a different method that we have added to the CFC. The CFC on each request gets the information, and sends it back as a one-dimensional array:
<html> <head> <title>CFTree Example</title> </head> <body> <h2>CFTree Example</h2> <cfform name="bob"> <cftree name="dirTree" format="html"> <cftreeitem bind="cfc:objTree.getDir({cftreeitempath},{cftreeitemvalue})"> </cftree> </cfform> </body> </html>
Now, we will have a look at the new method that we have added to our CFC so as to supply our tree view. The main method...