Core Framework: Application Structure

Applications developed using this framework are required to adhere to a few guidelines and specifications regarding file and directory structure and naming.

Framework files are distributed as a compressed file. The compressed file can be expanded into the application directory and serve as the initial foundation in which the application will be developed.

The following diagram shows the initial structure of a sample application:
Core Framework Application Layout
 

In this diagram "app" is the name of the directory where your application is located.

The following table describes each of the directories and its purpose:

Directory Description
config This directory is used to store any configuration files used by the application. If present, the framework uses a file named config.xml.cfm in this directory to obtain additional settings and configuration. Other configuration files can be placed here if the application requires them.
handlers All the event handlers are stored here. Event handlers are CFCs that handle all of the actions or events of the application. Event handlers must extend the eventHandler.cfc located on this directory.
images Used to keep any images used by the application, initially only contains a few images used by other parts of the framework.
includes Contains special purpose templates and reusable files
layouts Contains the page layouts for application pages. Layouts describe the overall structure of each page displayed; they also are responsible for displaying the selected view.
views Contains all application views. Views can be organized within subdirectories if needed.

 

The Application.cfc template acts as the application’s front controller controller. This is described in detail on the following section.
 

Overview  |  Controller  |  Event Handlers  |  Views  |  Layouts  |  Services  |  Settings  |  Modules

BlogCFC was created by Raymond Camden. This blog is running version 5.9. Contact Blog Owner