-
Notifications
You must be signed in to change notification settings - Fork 29
Controllers
inghamn edited this page Sep 14, 2012
·
1 revision
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.
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
- Coding Style
- Accessibility (Section 508)
- Progressive Enhancement
- Unobtrusive Javascript