Application (api) Class

Application class delegates all of the functionality of your applicaiton to Pages, Views, Controllers and Models.

Table of Contents:
Suggest a Resource

When you are developing your own application you typically would inherit one of Application Classes to make up your own Application object. By default it's located in lib/Frontend.php. This class is instantiated inside your top-most "index.php" file.

In your Application Class you may define more functions which you think should be available from anywhere (such as getCurrentUser()) and perform actions, which you think should always be performed (Such as connecting to DataBase)

* Why API classes extend AbstractView?

You may wonder, why Application class designed for command-line use extends the View. Why application is based on view in the first place?

The reason is because in descendants such as ApiFrontend it's essential that application would have it's own template and be capable of rendering itself. This could have been done through a separate object, but we decided to keep it simple and make it this way.

Core Class Reference (PHPDoc)

Class Description
ApiCLI Minimum API Implementation for Command-Line
ApiWeb Minimum Web Application. Great for integrating into other frameworks.
ApiFrontend Extends Web App with Routing, Layouts and Page Classes