controller

controller implements a MVC controller class. This is where the majority of your code that responds to the requests coming into your iPinga web application will be stored. Typically, you would create one method to handle each request. A request is nothing more than the URL the user went to. ie: http://example.com/user/get/1 might be the request that your application needs to respond to. In this example, this would typically invoke the user controller’s get method and pass as the first parameter the value 1. But, how you setup your routes is really up to you.

In your controller, you should handle any business logic and then create an array of values (sometimes referred to as a model) and pass that to the template object to render for your web application user.

All controllers should extend the controller class and must be stored in the filesystem folder defined in the path.controlllers setting. All controllers should be named in the format of file.controller.php where “file” is the first part of the class name. Class names should be in the format of “fileController” and must extend the \ipinga\controller class. All controllers must implement a index method even if you don’t intend to use it in your code.

Example: …\public_html\controllers\index.controller.php

…/public_html/index.php

Parent Class

None


Public Properties

$template
This is a reference to the internal template object, used to work with your view.
Data Type: \ipinga\template
Default Value: Empty

Public Methods

None