Skip to content
Marty Wallace edited this page Jul 13, 2016 · 2 revisions

To set up a Tempest application, there is an instantiate() method. The core class in Tempest (Tempest) is marked abstract. This is intentional as the framework expects you to define your own main application class that extends it:

use Tempest\Tempest;

class App extends Tempest {
    protected function setup() {
        // General setup code.
        // ...
    }

    protected function defineServices() {
        return array();
    }
}

Once you define your application class, you can use it's inherited static get() method to fetch an instance of it:

$app = App::get();

Note: Using App::instantiate() will also return an instance of App and only instantiate the application once. It is perfectly valid to wrap it in a global function that returns your App instance (the template actually does this itself).

Clone this wiki locally