Skip to content

Controllers

inghamn edited this page Sep 14, 2012 · 1 revision

Controllers

Controllers are responsible for populating the Templates. They must implement a default index() action to handle the base route of /controller.

The action functions to do whatever it is that needs to happen. Additionally, they should take the Template given to them and populate it with content.

Naming

Controllers are named a certain way so we don't have to spend a lot of code in the Front Controller to load them. They are usually named in the plural since that seems to lead to the most semantically readable code.

Examples:

  • ClientsController
  • LabelsController
  • PeopleController

In the routing, we are matching the names directly. We are not doing any inflections to change what's in the url to what the name should be, other than captitalizing the first letter.

  • /clients ==> ClientsController
  • /labels ==> LabelsController
  • /people ==> PeopleController

Developer Guide

Features

Principles

  • Coding Style
  • Accessibility (Section 508)
  • Progressive Enhancement
  • Unobtrusive Javascript
Clone this wiki locally