negative(-11) Documentation

Documentation Home

Controllers

The Controller layer handles all requests from the end user. It processes user input and calls upon the various models and components to fetch the data and resources it requires to produce meaningful output, via generated templates, to the user.

Loading Controllers

Controllers are called automatically by the Router upon page request, you should never have to reference them in code.

Methods are Pages

In the framework, Controller methods are how individual pages are loaded. By default, the main() method is loaded for each Controller. Supply additional methods to create additional pages that can be accessed via the URL (see Router for more on this). In this way, you can create Controllers that define a section, with each method defining a particular page in that section. Let's suppose we had a User_Controller Controller in our framework, along with the public methods: login, logout, reset_password, and join. We could access each of these pages like so:

	/user/login
	/user/logout
	/user/reset_password
	/user/join

© Copyright 2010 negative11.com