Overview

cfTrigger is a new kind of Coldfusion framework written following the Model View Controller framework. There are many ways of defining or understanding what MVC means. You can read more about it at Wikipedia: Model View Controller. Below is one of the very brief descriptions that should be enough for you to get started with cfTrigger if you're new to MVC.

What is Model View Controller or MVC?

MVC is basically a way of separating backend codes (i.e. coldfusion, php, jsp, databases codes, backend logic, etc.) from the frontend codes (i.e. html, css and js). Each of the 3 components (Model, View and Controller) is responsible for different aspects of the website functionality. From cfTrigger point of view, and likely to be the same for other frameworks, here are their main responsibilities:

  • Model: this is the most backend component, responsible for the database (or other kinds of storage) funtionalities. It handles backend logic such as how to save data to the database, how to get data out, how to perform searching logic, etc. SQLs are and should only be written here.
  • View: this is the frontend component, responsible for showing information to the user. This is what the end users will see. They are like pages on the website whose data is fed by models behind the scene.
  • Controller: this is the middle component that connects Model and View together. Controller, as the name implies, controls the flow of the website (logic flow not page navigation which is accessible via the menu navigation). Based on the user request, it determines what models need to be called, what functions need to be invoked and what view to be shown to the end user.

To get started, you first need to download cfTrigger and then install it.

To see more about how MVC is implemented in cfTrigger, please refer to the following pages:

Ask a Question on cfTrigger